How can I detect whether the mouse cursor is over my Win Form or not?

Hi,

The title says it,

Thanks!
EEssamAsked:
Who is Participating?
 
Jaime OlivaresConnect With a Mentor Software ArchitectCommented:
You can do it with:
if (yourForm.DesktopBounds.Contains(Cursor.Position))
{
}
0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
System.Windows.Forms.Control.MousePosition
or
System.Windows.Forms.Cursor.Position
0
 
Jaime OlivaresSoftware ArchitectCommented:
is your winform  top-level ?
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.