calling a event handler within another event handler?
问题 Here is the short sample code: private void txtbox1_DoubleClick(object sender, EventArgs e) { button1_Click(object sender, EventArgs e); //can I call button1 event handler? } private void button1_Click(object sender, EventArgs e) { MessageBox.Show(txtbox1.Text); } I wonder if it would be okay to code in the above way? 回答1: You can do that - although the code you provide can't be compiled. It should look like this: private void txtbox1_DoubleClick(object sender, EventArgs e) { button1_Click