private void button2_Click(object sender, EventArgs e) { var btnlist = GetButtons(this.panel1.Controls); //btnSave for (int i = 0; i < btnlist.Count; i++) { if (btnlist[i].Name == "btnSave_szslbg") { btnlist[i].PerformClick(); } MessageBox.Show("adddd11111111111111111111111111111111"); return; } }
用户控件上的按钮事件 ; 注意; 用户控件按钮 必须设置为可视; 否则出发不到; 可用标签遮挡该按钮;使其鼠标点击不到;
private void button1_Click(object sender, EventArgs e)
{
MessageBox.Show("子窗体事件!!");
}