Solved

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

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

The title says it,

Thanks!
0
Comment
Question by:EEssam
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 143

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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

717 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