Skip to content

Commit be95b05

Browse files
committed
Use RequiresScrollButtons to determine if menu is overflowed
1 parent 4875a71 commit be95b05

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

src/System.Windows.Forms/System/Windows/Forms/Controls/ToolStrips/ToolStripDropDownMenu.cs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -848,20 +848,14 @@ protected override void OnMouseWheel(MouseEventArgs e)
848848
{
849849
base.OnMouseWheel(e);
850850

851-
if (e.Delta == 0 || Items.Count == 0)
851+
if (e.Delta == 0 || Items.Count == 0 || !RequiresScrollButtons)
852852
{
853853
return;
854854
}
855855

856856
Rectangle firstItemBounds = Items[0].Bounds;
857857
Rectangle lastItemBounds = Items[Items.Count - 1].Bounds;
858858

859-
if (firstItemBounds.Top == DisplayRectangle.Top &&
860-
lastItemBounds.Bottom == DisplayRectangle.Bottom)
861-
{
862-
return;
863-
}
864-
865859
int delta = firstItemBounds.Height * SystemInformation.MouseWheelScrollLines * -Math.Sign(e.Delta);
866860

867861
if (delta < 0)

0 commit comments

Comments
 (0)