473,473 Members | 2,122 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

MouseMove event triggered even if the mouse is not moving

Hello!

If I understand correctly, MouseMove event is triggered when the mouse moves
(ie when point changes).
I, however, found out that it's triggered even if the mouse is not moving.

What I did was:

In an empty form, I set the Form1.Text to "0" and added the following code
for Form1.MouseMove event.

private void Form1_MouseMove(object sender,
System.Windows.Forms.MouseEventArgs e)
{
int i;
i = int.Parse(this.Text);
i++;
this.Text = i.ToString();
}

I put the mouse cursor on the form and I didn't touch the mouse.
The Text (form's caption) kept increasing at irregular speed (but pretty
fast).

I thought that It could be triggered by a little shake of the mouse.
So I changed the code.

I added

private int x;
private int y;

private void Form1_MouseMove(object sender,
System.Windows.Forms.MouseEventArgs e)
{
if (Math.Abs(e.X - x) + Math.Abs(e.Y - y) > 0)
{
int i;
i = int.Parse(this.Text);
i++;
this.Text = i.ToString();
}
x = e.X;
y = e.Y;
}
Now the Text didn't increase.

My conclusion is that the MouseMove event can be triggered even if the point
was not changed.

By the way, my mouse is MS optical mouse.

Is this by design?

Sam
Nov 16 '05 #1
0 1988

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

Similar topics

1
by: DraguVaso | last post by:
Hi, I need to know the Lenght of the Text in a DataGridTextBoxColumn when I move with the mouse over it, and show it in a ToolTip. I have something that works, but it works only when the...
0
by: Tim Mulholland | last post by:
I have written some code that causes mouseover effects on a picture box. The code works fine most of the time and creates some really nice effects. HOWEVER, If i try, i can get the effects to...
3
by: Tim Mulholland | last post by:
i posted this a while ago and never got a response, but i'm still having problems, so i thought i'd see if anyone had any sudden realizations this time Thanks in advance! Tim I have...
3
by: Crucifix | last post by:
Hello, I'm writing a small C# app, and part of what I'm trying to do involves the dragging of PictureBox controls on a form. Unfortunately, MouseMove seems to be behaving very oddly, causing...
3
by: TyBreaker | last post by:
I'm writing a screen saver using Visual Studio 2005 (Basic) and I have a Form which contains a PictureBox. I have two events, Click and MouseMove that I'd like to cause the program to end (see...
0
by: Vincent | last post by:
I have a hierarchical flex grid on an Access form and in the MouseMove routine for the flex grid I am changing the color of the cells as the mouse is moved over the cell. If I move the mouse...
0
missinglinq
by: missinglinq | last post by:
Having been asked, for the umpteenth time, how to use the MouseMove property to change the appearance of an object, I put together this short tutorial and sample database today. Perhaps it will be of...
4
by: info | last post by:
Hello everybody, I hope you can help me with my problem. I want to add the mousemove event to a class that doesn't have it (specifically it is the nationalinstruments.ui.xycursor from measurement...
1
by: Studlyami | last post by:
I have an application which has two mice devices. One is a trackball and the other is your standard computer mouse. I am using raw input (WM_INPUT) and I am able to identify both computer mice,...
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...
1
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
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,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...

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.