Advertisement
jsauto

Untitled

Apr 2nd, 2013
8,124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 0.55 KB | None | 0 0
  1.   Private Sub btn_run_Click(sender As System.Object, e As System.EventArgs) Handles btn_run.Click
  2.         Dim msgTxt As String = "你選的是" & vbCrLf
  3.         Dim ObjCB2 As RadioButton
  4.  
  5.         For Each tmpRB As Object In Me.Controls
  6.             If tmpRB.GetType.ToString() = "System.Windows.Forms.RadioButton" Then
  7.                 ObjCB2 = CType(tmpRB, RadioButton)
  8.                 If ObjCB2.Checked Then
  9.                     msgTxt = msgTxt + ObjCB2.Text + vbCrLf
  10.                 End If
  11.             End If
  12.         Next
  13.         MsgBox(msgTxt)
  14.   End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement