Hello, i have a problem with coloring background in combobox..
http://www.youtube.com/watch?v=2pHykCwn3_U
As you can see.. background is colored after mouse move on text.. what i should to do to get automatic colored background?
Printable View
Hello, i have a problem with coloring background in combobox..
http://www.youtube.com/watch?v=2pHykCwn3_U
As you can see.. background is colored after mouse move on text.. what i should to do to get automatic colored background?
This works fine for me
Probably your error is that you don't use the item indexCode:void comboBox1_DrawItem(object sender, DrawItemEventArgs e)
{
if (e.Index < 0) return;
if (comboBox1.Items[e.Index].ToString().Contains(".99."))
e.Graphics.FillRectangle(new SolidBrush(Color.Red), (Rectangle)e.Bounds);
e.Graphics.DrawString(comboBox1.Items[e.Index].ToString(), e.Font, new SolidBrush(comboBox1.ForeColor), new Point(e.Bounds.X, e.Bounds.Y));
}
Thanks a lot, its working fine now