标题:获取一组radiobutton选中项
取消只看楼主
shenhaoli
Rank: 1
等 级:新手上路
帖 子:24
专家分:2
注 册:2010-4-15
结帖率:75%
 问题点数:0 回复次数:2 
获取一组radiobutton选中项
获取一组radiobutton选中项只能用遍历的方法吗???
搜索更多相关主题的帖子: radiobutton 获取 
2010-04-19 15:31
shenhaoli
Rank: 1
等 级:新手上路
帖 子:24
专家分:2
注 册:2010-4-15
得分:0 
用中间量
很冷清,又想到了一个方法,用中间量
用一个中
程序代码:
Public Class frmradiobutton

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

        Me.Close()
    End Sub

    Private Sub frmradiobutton_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Rad1.Checked = True
        Radxb1.Checked = True
    End Sub

    Private Sub Rad1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Rad1.CheckedChanged
        TextBox1.Text = Rad1.Text
    End Sub

    Private Sub Rad2_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Rad2.CheckedChanged
        TextBox1.Text = Rad2.Text
    End Sub

    Private Sub Rad3_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Rad3.CheckedChanged
        TextBox1.Text = Rad3.Text
    End Sub

    Private Sub Radxb1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Radxb1.CheckedChanged
        TextBox2.Text = Radxb1.Text
    End Sub

    Private Sub radxb2_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles radxb2.CheckedChanged
        TextBox2.Text = radxb2.Text
    End Sub
End Class
间量存储每组控件的状态,当CheckedChanged改变该中间量,下面的例子我用的是textbox控件
2010-04-19 17:21
shenhaoli
Rank: 1
等 级:新手上路
帖 子:24
专家分:2
注 册:2010-4-15
得分:0 
谢谢
2010-04-19 17:22



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




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

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