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

checking click mouse

i'd like to check clicking mouse such as left click , right click , and
middle click

in addition, check wheel moving....how should i do?
Dec 4 '05 #1
2 1716
micky wrote:
i'd like to check clicking mouse such as left click , right click , and
middle click

in addition, check wheel moving....how should i do?

You need to handle MouseUp/MouseDown events:

//------------------------------
private void Form1_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
{
if (e.Button == MouseButtons.Left)
MessageBox.Show("Left Button");
else if (e.Button == MouseButtons.Right)
MessageBox.Show("Right Button");
else if (e.Button == MouseButtons.Middle)
MessageBox.Show("Middle Button");

MessageBox.Show("Mose wheel rotated " + e.Delta.ToString());
}
//------------------------------

where e.Delta is number of detents
Hope it helps,
MuZZy
Dec 4 '05 #2
i'd like to check on desktop area
i mean system area ,,,,when not focused on my program it have to work.
"MuZZy" <tn*@newsgroups.nospam> wrote in message
news:eu******************@TK2MSFTNGP15.phx.gbl...
micky wrote:
i'd like to check clicking mouse such as left click , right click , and
middle click

in addition, check wheel moving....how should i do?

You need to handle MouseUp/MouseDown events:

//------------------------------
private void Form1_MouseDown(object sender,
System.Windows.Forms.MouseEventArgs e)
{
if (e.Button == MouseButtons.Left)
MessageBox.Show("Left Button");
else if (e.Button == MouseButtons.Right)
MessageBox.Show("Right Button");
else if (e.Button == MouseButtons.Middle)
MessageBox.Show("Middle Button");

MessageBox.Show("Mose wheel rotated " + e.Delta.ToString());
}
//------------------------------

where e.Delta is number of detents
Hope it helps,
MuZZy

Dec 4 '05 #3

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

Similar topics

2
by: Csaba2000 | last post by:
I'd like to be able to simulate a mouse click on an arbitrary HTML element (for the purpose of invoking whatever behaviour that element would have, had a real mouse click come to it) so that my...
4
by: Csaba2000 | last post by:
I want to be able to programatically click on the center of an <INPUT type=image ...> element (I only care about IE 5.5+). This should work regardless of whether IE has focus. Normally you would...
2
by: Sean | last post by:
Hi, I have a treeview and user can right click the treenodes, depending on the nodes, different shortcut menu will appear. I want only the shortcut menu to appear if the point of the right...
1
by: Sakharam Phapale | last post by:
Hi All, How to capture Mouse Single click and mouse double click event on Commnad Button. I am doing as follows. Private void Button1_MouseUp(Object sender,...
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...
2
by: scott_gui | last post by:
I am creating a Windows application: The mouse event <Double-Button-1> has a conflict when the <Button-1> event also has a binding. Double clicks will first perform the single click action. This...
3
by: Morten Snedker | last post by:
If I have a number of random applications open, move the mouse cursor to a given position and do a click, the application gets the focus. That is what this simple code should illustrate: Dim...
5
by: moonie | last post by:
I have an msn style c# windows application with a form and panel on it. A news list is drawn from the database and dynamically added via labels, link lables during form loading. In this...
2
by: wpollans | last post by:
Hello, I need to able to write JS that will click on a link with the middle mouse button - so that the link target will open in a new window or tab - using firefox. Or is there a better (more...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...

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.