Search code examples
c#.netwinformswindows-forms-designermenustrip

Windows Forms | MenuStrip Sub-Items (ToolStripMenuItem) changing Cursor won't work


I want to have a Hand Cursor for all ToolStripMenuItems.

So i change it in the MouseEnter and MouseLeave Events with this.Cursor = Cursors.Hand; & this.Cursor = Cursors.Default;. I've disabled latter for debugging purpose, so i can see if it changes at all.

It only works for "Root" Items. Not for their Sub-ToolStripMenuItems. The Events fire, it's just like the Cursor get's overridden by Sub-Items.

Any help would be appreciated, it looks weird with the default Cursor. I am using the latest version of VS 2019 and work with .NET Framework 4.8

Here is a little screen:

Problem Description as Screen

System-Info:

  • Edition: Windows 10 Pro
  • Version: 20H2
  • OS-Build: 19042.746

Solution

  • This works fine for me, both for root and sub items:

        private void ...ToolStripMenuItem_MouseMove(object sender, EventArgs e)
        {
            this.Cursor = Cursors.Hand;
        }
    
        private void ..ToolStripMenuItem_MouseLeave(object sender, EventArgs e)
        {
            this.Cursor = Cursors.Default;
        }