473,396 Members | 1,933 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,396 software developers and data experts.

Mouse move

This is a addition to the question I did earlier.
What event should I use to make some think happen everytime the mouse moves
(anywhere on the screen)?

Nov 16 '05 #1
3 6883
For movements only within your own Windows Forms, the MouseMove event does
the job. If you need to be able to track the mouse outside screen real
estate that you control, set up a timer, and in the tick event get the
screen-relative mouse position via the Screen.MousePosition property, and do
whatever you need to do. To do something only when it moves, save the
current mouse position on each timer event, and compare the current mouse
position to the position you saved in the last event. If it's the same, do
nothing. If it's changed, do your thing.

HTH,
Tom Dacon
Dacon Software Consulting

"Tomomichi Amano" <to*********@hotmail.com> wrote in message
news:O7**************@TK2MSFTNGP11.phx.gbl...
This is a addition to the question I did earlier.
What event should I use to make some think happen everytime the mouse moves (anywhere on the screen)?

Nov 16 '05 #2
http://www.codeproject.com/csharp/GlobalSystemHook.asp

--
I am a 14 year old C# developer, I am completely self taught, so please don't get mad if I ask a stupid question. Thanks.
"Tomomichi Amano" wrote:
This is a addition to the question I did earlier.
What event should I use to make some think happen everytime the mouse moves
(anywhere on the screen)?

Nov 16 '05 #3
Bill English wrote:
http://www.codeproject.com/csharp/GlobalSystemHook.asp


A global system hook would be best in this case.
Although the timer tick way, suggested by Tom above, would be much easier thats for sure.
It might not be as smooth as a system hook, but im guessing here.

Good luck.
Nick Z.
Nov 16 '05 #4

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

Similar topics

3
by: Csaba2000 | last post by:
I have set onmousedown to change the cursor, but this setting is ignored (IE 5.5; NN 6.1 on Win 2K Pro) until the mouse is either moved or the mouse button is released. On Opera 7.01, the setting...
3
by: red | last post by:
mouse events when the mouse is on a "child control" hi everyone; my problem: I have a userControl in this usercontrol, I have a child control (a button) when the mouse moves over the...
1
by: suhas | last post by:
Hi, I have an MDI app that allows user to create flowcharts. User can drag flowchart objects (squares, rectangles, elipses, etc) from the toolbar and put on a form. They should be able to move...
1
by: Benny Raymond | last post by:
In my attempt to make a macro recording program where i can then playback mouse movements i'm running into a big problem: I'm trying to simulate the movement of the mouse to a point on the...
1
by: Boni | last post by:
Dear all, A mouse click on some object in my application should select this object, where mouse down should start moving until mouse up. But, when I press mouse down small move always happens. I...
5
by: Nick | last post by:
Hey guys, I have 2 events on a windows forms datagrid, the mouse move as well as the double click events. What's happening is that when I double click on a row in the grid, the mouse move event...
6
by: Rob | last post by:
This is a curious problem. It seems like it should be quite easy. Of course a timer is used to determine when form should be closed, but how do you consistently reset the timer when the mouse is...
19
by: wmanzo | last post by:
I have a really professional conspiracy movie site and I use tons of layers and an external scroll bar assembly. I would like to put the various sections into MS Iframes and in order to clean up...
3
by: wanwan | last post by:
I made a game with a window form that needs to record the mouse position to an array at 100 samples per second, so I use the mouse move event to do the job. The problem is the mouse move event...
2
by: markszlazak | last post by:
In the following script, a control displays (black box) in each table cell once you mouse over the cell. Mouse down on the control to change the mode of the table. Drag the mouse over cells in the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.