首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > C# >

为啥radioButton的checked属性赋值为true,页面中不选中

2012-12-27 
为什么radioButton的checked属性赋值为true,页面中不选中我winForm界面里有一个RadioButton,我在后台代码

为什么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没有被选中,请教高人!~~
[其他解释]
是不是在页面加载的时候又刷新了一遍?
[其他解释]
亲,你现在会了吗?我也有这个问题不会啊

热点排行