Monday, 20 May 2013

When are control events used in code?

When are control events used in code?

When using the windows form app, you can create an event for example a picturebox.Click event. Inside this method all code will be ran when the butten is clicked.
Now inside another event, I can call the method Button1.click, but what is it used for? Can it be used for statements like this?
private void pictureBox1_MouseMove(object sender, MouseEventArgs e)
{
    if(Button1.click == true) // If the button is clicked AND the mouse moves over the picturebox
    {
        //dance
    }
}

No comments:

Post a Comment