winforms icon indicating copy to clipboard operation
winforms copied to clipboard

Utilize Mouse Wheel for scrolling in ToolStripDropDownMenu

Open toehead2001 opened this issue 9 months ago • 3 comments

.NET version

9.0

Did it work in .NET Framework?

No

Did it work in any of the earlier releases of .NET Core or .NET 5+?

No

Issue description

The mouse wheel can't be used to scroll these menus when they're overflowed. You have to click the arrow buttons at the Top/Bottom. 🤮

To be clear, I'm talking about overflowed ToolStripDropDownMenu like this: Image

In Paint.NET, these menus can get overflowed easily if a user installs a lot of plugins.

Image

cc: @rickbrew

Steps to reproduce

Add many ToolStripMenuItem to a DropDown. For testing, I created a bunch of Menu items like this.

ToolStripMenuItem[] items = Enumerable
    .Range(0, 100)
    .Select(x => new ToolStripMenuItem(x.ToString()))
    .ToArray();

ToolStripMenuItem testMenu = new ToolStripMenuItem("Test");
testMenu.DropDownItems.AddRange(items);

MenuStrip menuStrip = new MenuStrip();
menuStrip.Items.AddRange(testMenu);

Controls.Add(menuStrip);

toehead2001 avatar Apr 14 '25 06:04 toehead2001

Thanks for the issue and the PR @toehead2001 ! We'll take a look.

merriemcgaw avatar Apr 14 '25 23:04 merriemcgaw

Thanks @toehead2001 for the PR. @JeremyKuhne will take point on reviewing your PR.

merriemcgaw avatar Apr 15 '25 18:04 merriemcgaw

Several years ago this was something that a surprisingly large number of folks were asking for in Paint.NET. The usability improvement was much more than I was expecting.

rickbrew avatar Apr 15 '25 23:04 rickbrew