If there is a requirement for calling a button click event from another button in c#, there is a easy way to do.We just need to call the PerformClick Method of the button to be fired.
private void button1_Click(object sender, EventArgs e) { button2.PerformClick(); } private void button2_Click(object sender, EventArgs e) { System.Windows.Forms.MessageBox.Show("I am called from button1"); }
Popularity: 12% [?]

November 8th, 2009
joy
Posted in
Tags:

