| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 823 人关注过本帖
标题:关于radiobutton控件与radiobuttonlist控件
只看楼主 加入收藏
lbwxqh
Rank: 1
等 级:新手上路
帖 子:28
专家分:0
注 册:2006-4-12
收藏
 问题点数:0 回复次数:1 
关于radiobutton控件与radiobuttonlist控件
请问一下,radiobutton与radiobuttonlist控件有什么不同吗,几个radiobutton构成一个组不就构成了一个radiobuttonlist了吗?还有检测radiobutton和radiobuttonlist的选中的值分别应该怎样来检测?谢了
搜索更多相关主题的帖子: 控件 radiobutton 
2006-07-18 10:51
parklee
Rank: 1
等 级:新手上路
帖 子:100
专家分:0
注 册:2006-6-8
收藏
得分:0 
for radiobutton:
void SubmitBtn_Click(Object Sender, EventArgs e)
{
if (Radio1.Checked)
{
Label1.Text = "You selected " + Radio1.Text;
}
else if (Radio2.Checked)
{
Label1.Text = "You selected " + Radio2.Text;
}
else if (Radio3.Checked)
{
Label1.Text = "You selected " + Radio3.Text;
}
}
</script>

for radiobuttonlist:
script runat="server">
void Button1_Click(object Source, EventArgs e)
{
if (RadioButtonList1.SelectedIndex > -1)
{
Label1.Text = "You selected: " +
RadioButtonList1.SelectedItem.Text;
}
}
void chkLayout_CheckedChanged(Object sender, EventArgs e)
{

if (chkLayout.Checked == true)
{
RadioButtonList1.RepeatLayout = RepeatLayout.Table;
}
else
{
RadioButtonList1.RepeatLayout = RepeatLayout.Flow;
}
}
void chkDirection_CheckedChanged(Object sender, EventArgs e)
{
if (chkDirection.Checked == true)
{
RadioButtonList1.RepeatDirection = RepeatDirection.Horizontal;
}
else
{
RadioButtonList1.RepeatDirection = RepeatDirection.Vertical;
}
}
</script>
radiobutton 可以复选。radiobuttonlist里的radio不可复选

2006-07-18 15:45
快速回复:关于radiobutton控件与radiobuttonlist控件
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.015768 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved