Solved

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

Posted on 2007-11-25
3
148 Views
Last Modified: 2013-12-16
Hi,

The title says it,

Thanks!
0
Comment
Question by:EEssam
  • 2
3 Comments
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 20346541
System.Windows.Forms.Control.MousePosition
or
System.Windows.Forms.Cursor.Position
0
 
LVL 55

Expert Comment

by:Jaime Olivares
ID: 20346548
is your winform  top-level ?
0
 
LVL 55

Accepted Solution

by:
Jaime Olivares earned 500 total points
ID: 20346557
You can do it with:
if (yourForm.DesktopBounds.Contains(Cursor.Position))
{
}
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question