标题:关于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



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-78952-1-1.html




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

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