Mouse events

A

Adeel

Hi group!

I'm trying to learn C# on my own... I'd appreciate it very much if someone
can help me out here.

I have a basic form without any controls on it... I want to catch mouse
clicks (both left and right). When I select the form and go to the events
tab (the bolt icon in properties), it gives me several options to choose
from...

Under 'Action', I have Click and MouseClick and under 'Mouse', I see various
mouse events listed. Can anyone tell me what is the basic difference between
all of these? And how do I go about catching right-button click?


Thank you for all your help

Regards,
Adeel
 
I

Ignacio Machin \( .NET/ C# MVP \)

Hi,

| Hi group!
|
| I'm trying to learn C# on my own... I'd appreciate it very much if someone
| can help me out here.
|
| I have a basic form without any controls on it... I want to catch mouse
| clicks (both left and right). When I select the form and go to the events
| tab (the bolt icon in properties), it gives me several options to choose
| from...
|
| Under 'Action', I have Click and MouseClick and under 'Mouse', I see
various
| mouse events listed. Can anyone tell me what is the basic difference
between
| all of these? And how do I go about catching right-button click?


Reading the docs will give you a very good idea of what each event means, of
course they are self explanatories to start with
 
S

Stoitcho Goutsev \(100\)

I agree with Ignacio that the docs (MSDN) has rather extensive explanation
on what the events do and what are differences between them, so I also
suggest to read through them.

However there is simple and brief explanation what the difference is. Click
event is generic even - take a look on the Button control for example it can
be clicked by the mouse, by pressing space key when the focus is on the
button, pressing the enter when the button is set as a default button, etc.
These are all click and the Click event will be fired for all thouse
actions. In contrast MouseClick (which is new for .NET 2.0 btw) is firead
only if the button has been clicked by using the mouse. Because of that it
can provied more information related to the mouse such as Which mouse has
been used to perform the click, how many times the mouse button has been
clicked, etc. This infromation comes packed as event arguments object.

Once again I'd suggest to consult the docs; usually the provide enough
information.
 
A

Adeel

Thanks for the replies guys... I did try to consult the docs first but,
although it might sound silly, I wasn't able to find a starting point. How
do I find the relevant information?

The search utility included in MSDN doesn't return correct results at
times... and without knowing how the pages have been organized, it is very
difficult to locate the correct articles. Any pointers there...? A link
would be useful..

Thanks

Regards,
Adeel
 
A

Adeel

Thank you very much Dave. I was apparently looking at it from a different
angle... and consequently was typing in obscure queries...!


Regards,
Adeel
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top