[英]How do I change the name of a label if a specific radio button is checked?
Through coding, if lets say radioButton2 is checked, how do I have the Text property for the Label label1 change to, for example, "Enter a different value"?通过编码,如果让我们说 radioButton2 被选中,我如何将 Label label1 的 Text 属性更改为例如“输入不同的值”?
private void radioButton2_CheckedChanged(object sender, EventArgs e)
{
}
This is very simple you should keep exploring but just for help这很简单,你应该继续探索,但只是为了帮助
private void radioButton2_CheckedChanged(object sender, EventArgs e)
{
if(radioButton2.Checked)
{
label1.Text = "Enter a different value";
}
}
Well, why can't you just set the Text
property of label in your event handler like那么,你为什么不能在你的事件处理程序中设置标签的
Text
属性,比如
private void radioButton2_CheckedChanged(object sender, EventArgs e)
{
label1.Text = "Enter a different value";
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.