How do I change the default colors for MenuStrip control? I can easily change the primary ForeColor and BackColor, but can't figure out how to change the hover and click colors.
Change MenuStrip colors
Forum rules
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Re: Change MenuStrip colors
Menustrip doesn't have built in for color changes when you hover or click, but you probably can use the MouseEnter and MouseLeave events of the menu items to create the effect.
In the event block you can change the menu item's font and colors.
In the event block you can change the menu item's font and colors.
PowerShell Code
Double-click the code block to select all.$ToolStripMenuItem_MouseEnter={ $this.Font = New-Object System.Drawing.Font -Args ($menustrip1.Font.FontFamily, $menustrip1.Font.Size, [System.Drawing.FontStyle]::Bold) $this.ForeColor = 'Red' } $ToolStripMenuItem_MouseLeave={ $this.Font = $menustrip1.Font $this.ForeColor = $menustrip1.ForeColor }David
David
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.