读书人

为啥radioButton的checked属性赋值为t

发布时间: 2012-12-27 10:17:10 作者: rapoo

为什么radioButton的checked属性赋值为true,页面中不选中
我winForm界面里有一个RadioButton,我在后台代码里this.RadioButton1.checked=true;
但是每次打开界面的时候还是没选中,请问是为什么?
[最优解释]
可以啊
[其他解释]
private void Form1_Load(object sender, EventArgs e)
{
int i = 1;
if (i == 1)
{
this.radioButton1.Checked = true;
}
else
{
this.radioButton2.Checked = true;
}

}
是这样吗?我运行了没问题
[其他解释]
我这里有两个radioButton,我做了一个判断
if(.....)
{
this.RadioButton1.checked=true;
}
else
{
this.RadioButton2.checked=true;
}
我调试进了if里面,执行了this.RadioButton1.checked=true,可当页面加载出来,radiobutton1没有被选中,请教高人!~~
[其他解释]
是不是在页面加载的时候又刷新了一遍?
[其他解释]
亲,你现在会了吗?我也有这个问题不会啊

读书人网 >C#

热点推荐