G
Guest
I'm wondering how to loop through controls in VB.NET. I have the code from VB6 ok, but I can't figure out how to do it correctly in .NET. This is an example from my VB6 code that loops through controls in a specific frame on a form and unselects the option buttons. .NET barks at this line of code: thiscontrol.value = False
Private Sub UnSelectOpts(ByVal passedframeCaption As String)
Dim thiscontrol As Control
For Each thiscontrol In Me 'Iterate through each element.
If TypeOf thiscontrol Is OptionButton Then
If thiscontrol.Container = passedframeCaption Then
thiscontrol.Value = False
end if
end if
Next
End sub
How can I clear the option buttons?
Private Sub UnSelectOpts(ByVal passedframeCaption As String)
Dim thiscontrol As Control
For Each thiscontrol In Me 'Iterate through each element.
If TypeOf thiscontrol Is OptionButton Then
If thiscontrol.Container = passedframeCaption Then
thiscontrol.Value = False
end if
end if
Next
End sub
How can I clear the option buttons?