Yes, exactly same as the title, in my project some of toolstripmenuitems were disabled. But when i bring the cursor over the menu item, a blue border is appearing like this:
But i don't want this. I want it like this:
Could you help me, how do i prevent this blue border?
You should create a custom ToolStripRenderer
, take a look at this - How to: Set the ToolStrip Renderer for an Application
You have to create a custom renderer like this:
class CutomToolStripMenuRenderer : ToolStripProfessionalRenderer
{
protected override void OnRenderMenuItemBackground(ToolStripItemRenderEventArgs e)
{
if (e.Item.Enabled)
base.OnRenderMenuItemBackground(e);
}
protected override void OnRenderButtonBackground(ToolStripItemRenderEventArgs e)
{
if (e.Item.Enabled)
base.OnRenderMenuItemBackground(e);
}
}
And then set this renderer to your menu strip:
menuStrip1.Renderer = new CustomToolStripRenderer();