【发布时间】:2021-11-26 12:06:36
【问题描述】:
我已尝试在此处搜索解决方案,但似乎没有可用的解决方案。这两个单选按钮位于一个组框中。
代码:
private void radioButton_CheckedChanged(object sender, EventArgs e)
{
RadioButton senderControl = sender as RadioButton;
if (!senderControl.Checked)
return;
switch ((sender as RadioButton).Text)
{
case "radioButton1":
textBox4.Clear();
comboBox6.Enabled = false;
textBox4.ReadOnly = true;
textBox4.Enabled = false;
textBox4.Text = "000";
break;
case "radioButton2":
textBox4.Clear();
comboBox6.Enabled = true;
textBox4.ReadOnly = false;
textBox4.Enabled = true;
textBox4.Text = "";
break;
}
}
它不想工作,因为它什么都不做
【问题讨论】:
标签: c# radio-button