private void btns5_Click(object sender, System.EventArgs e) { // 2 该事件主要是:当点击button11的时候触发跳转到窗口“pass” if (button11.Text.Equals("药品入库")) // 2-1 判断button11是属于哪个大板块(button5、button6、button7、button8、button9、button10)的button11 { pass pa = new pass(); pa.ShowDialog(); //MessageBox.Show(((Button)sender).Text + " was clicked !"); //通过sender判断激发事件的控件 } }
private void btns8_Click(object sender, System.EventArgs e) { //同上2 if (button11.Text.Equals("其他功能")) { //同上2-1 pass pa = new pass(); pa.ShowDialog(); //MessageBox.Show(((Button)sender).Text + "lvkun !"); //通过sender判断激发事件的控件 } }