471,570 Members | 927 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,570 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 1660
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Csaba2000 | last post: by
2 posts views Thread by Sean | last post: by
2 posts views Thread by scott_gui | last post: by
3 posts views Thread by Morten Snedker | last post: by
5 posts views Thread by moonie | last post: by
reply views Thread by XIAOLAOHU | last post: by
reply views Thread by Vinnie | last post: by
reply views Thread by lumer26 | last post: by

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.