File tree 1 file changed +7
-10
lines changed
src/System.Windows.Forms/System/Windows/Forms/Controls/ToolStrips
1 file changed +7
-10
lines changed Original file line number Diff line number Diff line change @@ -4578,10 +4578,11 @@ protected override void WndProc(ref Message m)
4578
4578
{
4579
4579
SnapFocus ( ( HWND ) ( nint ) m . WParamInternal ) ;
4580
4580
4581
- // For fix https://github.com/dotnet/winforms/issues/12916
4582
- // Narrow down the range, because ToolStripDropDown is ToolStrip too. we only need to set outer ToolStrip active.
4581
+ // For fix https://github.com/dotnet/winforms/issues/13400
4582
+ // Narrow down the range because TransparentToolStrip (at design time) is also a ToolStrip. We only need to set the outer ToolStrip as active.
4583
4583
if ( IsOuterToolStrip ( this ) )
4584
4584
{
4585
+ // For fix https://github.com/dotnet/winforms/issues/12916
4585
4586
ToolStripManager . ModalMenuFilter . SetActiveToolStrip ( this ) ;
4586
4587
}
4587
4588
}
@@ -4653,17 +4654,13 @@ protected override void WndProc(ref Message m)
4653
4654
4654
4655
static bool IsOuterToolStrip ( ToolStrip toolStrip )
4655
4656
{
4656
- static ToolStrip getParentToolStrip ( ToolStrip toolStrip )
4657
+ ToolStrip tempToolStrip = toolStrip ;
4658
+ while ( tempToolStrip . Parent is ToolStrip parentControl )
4657
4659
{
4658
- if ( toolStrip . Parent is ToolStrip parent )
4659
- {
4660
- return getParentToolStrip ( parent ) ;
4661
- }
4662
-
4663
- return toolStrip ;
4660
+ tempToolStrip = parentControl ;
4664
4661
}
4665
4662
4666
- return toolStrip == getParentToolStrip ( toolStrip ) ;
4663
+ return toolStrip == tempToolStrip ;
4667
4664
}
4668
4665
}
4669
4666
You can’t perform that action at this time.
0 commit comments