sender

I use sender so seldomly that I forget what it is used for:

private void labelDescription_MouseHover(object sender, System.EventArgs e)
            {

            }


What is sender in this MouseHover event skeleton method?
LVL 5
Tom KnowltonWeb developerAsked:
Who is Participating?
 
YurichConnect With a Mentor Commented:
it will be a control which you set your MouseHover event on, e.g. a button if you set this handler for a button.

to check what it is, you can do the following:

private void labelDescription_MouseHover(object sender, System.EventArgs e)
{
       MessageBox.Show( sender.ToString());
}
0
 
Tom KnowltonWeb developerAuthor Commented:
ONE DAY this will STICK in my brain.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.