111,129
社区成员
发帖
与我相关
我的任务
分享
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
comboBox1.SelectedIndex = 1;
}
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
{
}
private void comboBox1_DrawItem(object sender, DrawItemEventArgs e)
{
SolidBrush s=new SolidBrush(Color.Blue);
string sss=comboBox1.Items[e.Index].ToString();
e.Graphics.DrawString(sss, new Font("宋体", 10), s, new Point(e.Bounds.X, e.Bounds.Y));
}
}
}