rajtofar
July 18th, 2002, 01:39 AM
HI all,
I'm developing this code where I need to trap the controls which are type radiobutton. I have a form which has a panel and in that panel there are 10 group boxes, each having one label and four radio buttons.
I need to run a loop through the controls to look for radio buttons.
this is the code i wrote......
'##############Test Code###############
ctrl = New Object()
control = New System.Windows.Forms.RadioButton()
For Each ctrl In Me.Panel1.Controls
For Each control In ctrl.controls
If Not control = System.Windows.Forms.Label() Then
If control.checked = True Then
MsgBox(control.name)
End If
End If
' MsgBox(control.name)
Next control
Next ctrl
'#################End test code##########
Now the line in Bold doesn't work. How can I trap which is the current control???
rajtofar
I'm developing this code where I need to trap the controls which are type radiobutton. I have a form which has a panel and in that panel there are 10 group boxes, each having one label and four radio buttons.
I need to run a loop through the controls to look for radio buttons.
this is the code i wrote......
'##############Test Code###############
ctrl = New Object()
control = New System.Windows.Forms.RadioButton()
For Each ctrl In Me.Panel1.Controls
For Each control In ctrl.controls
If Not control = System.Windows.Forms.Label() Then
If control.checked = True Then
MsgBox(control.name)
End If
End If
' MsgBox(control.name)
Next control
Next ctrl
'#################End test code##########
Now the line in Bold doesn't work. How can I trap which is the current control???
rajtofar