日期:2014-05-19  浏览次数:21006 次

如何在单击一个按钮事件的同时触发另一个页面的一个按钮的单击事件
用c#可以完成吗

------解决方案--------------------
public Form1()
{
InitializeComponent();
}

private void button1_Click(object sender, EventArgs e)
{
Form2 form2 = new Form2();
textBox1.Text = "You have clicket the button ";
form2.Show();
form2.ClickButtonRequest();
}


public Form2()
{
InitializeComponent();
}

private void button1_Click(object sender, EventArgs e)
{
textBox1.Text = "The button is clicked by Form1 ";
}

public void ClickButtonRequest()
{
button1.PerformClick();
}