Possible to change the highlight colour in listbox?

Have you already attempted this by taking ownership of the drawing of the ListBox and handling the customization in the DrawItem event handler?
 
Winston:
Here is a piece of code to get you started. Check out the System.Windows.Forms.DrawItem documentation for some more detail.

Code:
// listBox1 has DrawMode property set to DrawMode.OwnerDrawFixed

// Event handler for listBox1.DrawItem event 
private void listBox1_DrawItem(object sender, System.Windows.Forms.DrawItemEventArgs e)
{
    // Render listBox1 background
    e.DrawBackground();

    if((e.State & DrawItemState.Selected) == DrawItemState.Selected)
    {
             // If item is selected, draw a red selection box
	e.Graphics.FillRectangle(Brushes.Red, e.Bounds);

              // Draw white text
	e.Graphics.DrawString(this.listBox1.Items[e.Index].ToString(), this.listBox1.Font, Brushes.White, new Rectangle(e.Bounds.X, e.Bounds.Y, e.Bounds.Width, e.Bounds.Height));

    }
    else
    {

             // If item is not selected, just draw text in black
	e.Graphics.DrawString(this.listBox1.Items[e.Index].ToString(), this.listBox1.Font, Brushes.Black, new Rectangle(e.Bounds.X, e.Bounds.Y, e.Bounds.Width, e.Bounds.Height));

    }
}
 
Back
Top