标签:
public form1() { InitializeComponent(); this.radioButton1.CheckedChanged += new EventHandler(this.radioBtn_CheckedChange);//初始化事件 this.radioButton2.CheckedChanged += new EventHandler(this.radioBtn_CheckedChange); } private void form1_Load(object sender, EventArgs e) { } private void radioBtn_CheckedChange(object sender, EventArgs e) //根据button的text进行选择 { if (!((RadioButton)sender).Checked) { return; } switch (((RadioButton)sender).Text.ToString()) { case "开始扫描工位":break; case "结束扫描工位":break; } }
radioButton事件重载,用于多选择按钮的情形,不用每一个radiobutton都添加选中执行事件
标签:
原文地址:http://www.cnblogs.com/lilixiang-go/p/4662136.html