以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  如何获取GroupBox标题和选中的值  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=86574)

--  作者:nothing
--  发布时间:2016/6/20 22:32:00
--  如何获取GroupBox标题和选中的值

图片点击可在新窗口打开查看此主题相关图片如下:201562720492582992.png
图片点击可在新窗口打开查看


想通过代码得到GroupBox1的标题和该组中选中的值,比如第一组选中优秀,第二组选中良好

Dim 选值1 As String 
选值1  = e.Form.Controls("GroupBox1").标题  & ":" & 该组被选中值的标题

--  作者:nothing
--  发布时间:2016/6/20 22:38:00
--  
标题查到了,用Text
e.Form.Controls("GroupBox1").text
--  作者:大红袍
--  发布时间:2016/6/20 23:25:00
--  

参考代码

 

Dim str As String = e.Form.controls("GroupBox1").Text

For Each c As object In e.Form.controls("GroupBox1").Children
    If Typeof c Is winform.RadioButton Then
        If c.checked Then
            str = str & " " & c.text
        End If
    End If
Next
msgbox(str)