Skip to content

Commit 505b347

Browse files
committed
Issue #3 fixed
1 parent a3b31b1 commit 505b347

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

System/Windows/Forms/Application.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,17 @@ private bool _IsHovered(Control control, System.Drawing.Point mousePosition)
128128
var mouseToClient = control.PointToClient(mousePosition);
129129
var controlForm = GetRootControl(control) as Form;
130130
if (control.Context || (controlForm != null && controlForm == _FormAt(mousePosition)))
131+
{
132+
if (control.Context == false)
133+
{
134+
for (int i = 0; i < Contexts.Count; i++)
135+
{
136+
var contextControl = Contexts[i];
137+
var contextRect = new System.Drawing.Rectangle(contextControl.Location.X, contextControl.Location.Y, contextControl.Width, contextControl.Height);
138+
if (contextRect.Contains(mousePosition))
139+
return false;
140+
}
141+
}
131142
if (control.ClientRectangle.Contains(mouseToClient))
132143
{
133144
if (control.mouseEntered == false)
@@ -140,6 +151,7 @@ private bool _IsHovered(Control control, System.Drawing.Point mousePosition)
140151
control.RaiseOnMouseHover(new MouseEventArgs(MouseButtons.None, 0, mouseToClient.X, mouseToClient.Y, 0));
141152
return true;
142153
}
154+
}
143155

144156
return false;
145157
}

0 commit comments

Comments
 (0)