C# 有2个文本框textbox1和textbox2,然后有两个radiobutton1和2分别对应了文本框。

2025-02-25 04:49:27
推荐回答(2个)
回答1:

接楼上的 假设学号的textbox 为textBoxNumer
在radioButton2的CheckedChanged事件中写
private void radioButton2_CheckedChanged(object sender, EventArgs e)
{
if(radioButton2.Checked)
{
textBoxNumer.Text = ""; //或者string.Empty
}
}

回答2:

假设学号的textbox 为textBoxStudent。
可以设置当触发按姓名查找的时候,textBoxStudent.text=string.Empty;