Solved

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

Posted on 2007-11-25
3
147 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]
Comment Utility
System.Windows.Forms.Control.MousePosition
or
System.Windows.Forms.Cursor.Position
0
 
LVL 55

Expert Comment

by:Jaime Olivares
Comment Utility
is your winform  top-level ?
0
 
LVL 55

Accepted Solution

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

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

771 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now