I have some mechanism to hide mouse when application works.
But now I added a context menu for the main window form. So when mouse is under the context menu it hides mouse always.
How to detect if the mouse is over the context menu?
Thank you for any clue!
P.S.
This code hides mouse when app works
void CursorTimer_Tick(object sender, EventArgs e)
{
TimeSpan delta = DateTime.Now.Subtract(this.CursorLastMoveTime);
if (delta.TotalSeconds > 3)
{
CursorTimer.Stop();
Mouse.OverrideCursor = System.Windows.Input.Cursors.None;
}
}
The ContextMenu control has a property
IsMouseOver(as do all other UI controls). You can use that to detect when the mouse is over the menu.