先贴代码 private void listBox2_DrawItem(object sender, DrawItemEventArgs e)
{
Brush b;
string str = listBox2.Items[e.Index].ToString();
int z = str.IndexOf(" ");
string sj = str.Substring(z);
if (gettime(sj)==true)//方法,判断用哪种颜色
{
b = new SolidBrush(Color.Black);
}
else
{
b = new SolidBrush(Color.Red);
}
e.Graphics.DrawString(str, this.Font, b, e.Bounds);
}虽然我实现了我希望突出显示的项的颜色,但是这个列表框却不能选中了,点点没反映求高手帮忙解答
{
Brush b;
string str = listBox2.Items[e.Index].ToString();
int z = str.IndexOf(" ");
string sj = str.Substring(z);
if (gettime(sj)==true)//方法,判断用哪种颜色
{
b = new SolidBrush(Color.Black);
}
else
{
b = new SolidBrush(Color.Red);
}
e.Graphics.DrawString(str, this.Font, b, e.Bounds);
}虽然我实现了我希望突出显示的项的颜色,但是这个列表框却不能选中了,点点没反映求高手帮忙解答
private void listbox2_MouseDoubleClick(object sender, MouseEventArgs e)
这些相应的事件你都怎么编写的?