3

I have an application with a MenuStrip and every time I hover my mouse over a MenuItem, it highlights blue.

I have tried to change the BackColor and ForeColor but that wasn't the problem.

Is there a way to disable this?

LarsTech
  • 80,625
  • 14
  • 153
  • 225
number27
  • 93
  • 1
  • 3
  • 8

1 Answers1

9

This would be incredibly un-useful to the end user:

internal class NoHighlightRenderer : ToolStripProfessionalRenderer {
  protected override void OnRenderMenuItemBackground(ToolStripItemRenderEventArgs e) {
    if (e.Item.OwnerItem == null) {
      base.OnRenderMenuItemBackground(e);
    }
  }
}

Then apply it to your MenuStrip:

menuStrip1.Renderer = new NoHighlightRenderer();
LarsTech
  • 80,625
  • 14
  • 153
  • 225