public void main() { pictureBox.Click += new EventHandler(pictureBox_Click); } public void pictureBox_Click(object obj, EventArgs ea) { // This get executed if the pictureBox gets clicked }
public void main(){ PictureBox1.Click += new EventHandler(MyControl_Click); CheckBox1.Click += new EventHandler(MyControl_Click); Label1.Click += new EventHandler(MyControl_Click);}public void MyControl_Click(object obj, EventArgs ea){ // This get executed if the pictureBox, checkbox or label gets clicked}
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)