问题
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?
回答1:
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();
来源:https://stackoverflow.com/questions/26508662/disable-toolstripmenuitem-highlight