就是想把 选中的radiobutton控件的text显示在lable中 下面是我的代码 string str = "asd";
foreach (Control c in this.Controls)
{
if (c is RadioButton)
{
if (((RadioButton)c).Checked == true)
{
str = ((RadioButton)c).Text;
}
}
}
Label3.Text = str;
这个是在web asp.net中编写的 ……web 和 winform 编程的大概区别是什么??
foreach (Control c in this.Controls)
{
if (c is RadioButton)
{
if (((RadioButton)c).Checked == true)
{
str = ((RadioButton)c).Text;
}
}
}
Label3.Text = str;
这个是在web asp.net中编写的 ……web 和 winform 编程的大概区别是什么??
解决方案 »
- Ajax CalendarExtender问题
- 来者有分,在javascript如何创建datatable也就是ajaxpro.net中的datatable??
- 【征集帖】asp.net的运行机制,.net大框架的运行机制
- 弹出窗口出错,很着急
- 为分页查询写得一个语句,问题出在那里
- 请问如何判断数据库是否存在的问题,谢谢
- 在ASP.NET中如何与SQL.Server 2000相连接
- windows 2003上装了VS2003,但运行aspx文件的时候出现如下错误!改如何解决啊?
- 我现在要从 一个 页面中,生成一个新的页面,有哪位知道 语句改怎么写 ?
- datagrid问题
- 在.aspx页面中调用JS文件中的函数报错:缺少对象?????
- 请问如何关闭excel进程
Win Form应用程序需要部署到客户端,用户通过专门为该程序打造的用户界面与其交互。
{
foreach (System.Windows.Forms.Control control in c)
{
if (control.HasChildren)
{
FindControl(control.Controls);
}
else
{
if (control is RadioButton)
{
RadioButton rdb= control as RadioButton;
}
}
}
}
foreach (Control c in this.form1.Controls)
{
if (c is RadioButton)
{
if (((RadioButton)c).Checked == true)
{
str = ((RadioButton)c).Text;
}
}
}
Label3.Text = str;在foreach的条件中 有form1