First of all, we must set a new DrawMode Event for our Listbox
OurListBox.DrawMode = DrawMode.OwnerDrawFixed;
OurListBox.DrawItem += new DrawItemEventHandler(OurListBox1_DrawItem);
Now, when the Listbox is drawn, the application will call the function OurListBox1_DrawItem and is here when we change the font style.
private void OurListBox1_DrawItem (object sender, DrawItemEventArgs e)
{
e.DrawBackground();
e.Graphics.DrawString(OurListBox.Items[e.Index].ToString(), new Font("Microsoft Sans Serif", 8, FontStyle.Regular), Brushes.DarkBlue, e.Bounds);
e.DrawFocusRectangle();
}
and ... done it!, You will have yours list items in DarkBlue color.
Question? hehehe.
Greetings