Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 156
  • Last Modified:

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

Hi,

The title says it,

Thanks!
0
EEssam
Asked:
EEssam
  • 2
1 Solution
 
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
 
Jaime OlivaresSoftware ArchitectCommented:
You can do it with:
if (yourForm.DesktopBounds.Contains(Cursor.Position))
{
}
0

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now