c# windows form event handling

I'm having a problem coding a windows form using Visual Studio IDE the book I'm using is about as clear as mud. How do you code a button so it triggers an event in a label? I know this question is vague, but just need a hint if i'm still confused i'll ask other questions.
Who is Participating?
Mike TomlinsonMiddle School Assistant TeacherCommented:
Double click the button in the IDE...

private void button1_Click(object sender, System.EventArgs e)
    label1.Text = "something...";
Fahad MukhtarDistinguished EngineerCommented:
following code raises the label click event from button click event

     private void button1_Click(object sender, EventArgs e)
            label1_Click(button1, e);

        private void label1_Click(object sender, EventArgs e)
            if (sender is Button) // if the button is clicked
            label1.Text = "Lable Click Event Fired(from button)";
            else //if the label itself clicked
            label1.Text = "Lable Click Event Fired";
First, select the control -> In the properties windows, select events icon (a lightning shape) -> double click the event you want (you can enter a name or use the default name of the event) -> Write handing code
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.