473,320 Members | 2,124 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

MouseEventHandler != this.controlname.MouseEnter ?

I am trying to figure out how to use MouseEnter or MouseLeave events, and be
able to use the EventArgs to determine where the mouse cursor is. To my
great confusion, the MouseEnter and MouseLeave events are not
MouseEventHandlers.

so am I missing something, or is my .NET install messed up? it seems to me
that an event caused by a mouse being somewhere on the screen, should have
MouseEventArgs attached to it, not System.EventArgs.

but then again, maybe I am expecting too much, that the .NET framework be
logical. anyone have any advice on how to get this done, or should I just
assume events arent going to help me here and figure out how to determine
the location of the cursor manually?
thanks
NICK
Nov 16 '05 #1
1 2607
Nick,

You are right, the MouseEnter and the MouseLeave events do not have
position information associated with them. However, you can get the current
cursor position by calling the static Position property onthe Cursor class.
This will tell you where the cursor is in relation to the screen.

Because it is in screen coordinates, you have to convert them to local
coordinates (in relation to the control). In order to do this, you can pass
the coordinates to the PointToClient method on the Control class.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"SeaNICK" <ed*******@hotmail.com> wrote in message
news:Ok*************@TK2MSFTNGP11.phx.gbl...
I am trying to figure out how to use MouseEnter or MouseLeave events, and
be able to use the EventArgs to determine where the mouse cursor is. To my
great confusion, the MouseEnter and MouseLeave events are not
MouseEventHandlers.

so am I missing something, or is my .NET install messed up? it seems to me
that an event caused by a mouse being somewhere on the screen, should have
MouseEventArgs attached to it, not System.EventArgs.

but then again, maybe I am expecting too much, that the .NET framework be
logical. anyone have any advice on how to get this done, or should I just
assume events arent going to help me here and figure out how to determine
the location of the cursor manually?
thanks
NICK

Nov 16 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Matt | last post by:
If we use GET protocol, we can use either Request("controlname") or Request.QueryString("controlname") to get the data entered by the user. But if we use POST protocol, we MUST use...
8
by: Robert Megee | last post by:
I'd like to be able to make a web controls such as a textbox either visible or not-visible by using the name of the textbox in a string and using that string in some command. sort of like: string...
4
by: Arif | last post by:
how to display combobox contents(the same function that occurs when Mouse is pressed on a combobox but) on MouseEnter/MouseHover events? arif.
4
by: Paul | last post by:
Hi, noticed high activity on this newsgroup as the last few posts I have made have not received a response. Anyhow I noticed that with a .NET web application when the webform opens if the user...
0
by: Charles Law | last post by:
Is there a way to get the MouseEnter event to fire for a user control that inherits from UpDownBase? The event is hidden, and does not fire when the mouse enters the control. TIA Charles
5
by: Just Me | last post by:
Given a button name Btn_5 and Index=5 I want to do something like dim zz as string = Btn_??Index??.Text or given an array of buttons, do:
1
by: Mark Reed | last post by:
Hi All, I'm having a problem with the following code. I've read quite a lot of old posts regarding the issue but none seem to affer a solution. The scenario is. I have a bound form which...
4
by: =?Utf-8?B?R2lkaQ==?= | last post by:
Hi, I've a MouseEnter event on a dataGrid, and I want to know, if the mouse entered column no. 0 or column no. 1 . How can it be done? Thanks, Gidi.
8
by: shaielinna | last post by:
<? ob_start(); session_start(); require('../includes/inc.php'); require('../includes/settings.php'); include("../includes/dbconnect.php");?> <?php // requires the class require...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.