about the click event

T

Tony Johansson

Hello!

Can somebody explain what is the difference between these two events. Both
are called when I click the Button control ?

private void Button1_Click(object sender, EventArgs e)
{

}

private void Button1_MouseClick(object sender, MouseEventArgs e)
{

}

//Tony
 
J

James J

Hi Tony Johansson,

Very Intelligent Question.

now come to your answer.

first of all i want to tell that when you use both event & press by mouse left button click then both will execute. first will execute "Button1_Click" & then it will execute "Button1_MouseClick".

Now what is difference?

sometimes user use the tab button for focus from one control to another control ok. at that time when user will press tab & your "Button1" control will get focus & then user will press "SPACE" or "ENTER" then it will execute only "Button1_Click" event.


When user will press button by mouse then it will execute both events & first will be "Button1_Click" & then "Button1_MouseClick".


Hope now you will got the exact difference between both events.

I hope that my answer will helpful for you.

Regards
James J.

Submitted via EggHeadCafe
Microsoft .NET DataBase Access For Beginners
http://www.eggheadcafe.com/training...Server-Oracle-DB2-Informix-Query-Samples.aspx
 

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