S
Steven Smith
Hi guys I'm using object variables to address several
controls on a form like so...
Private Sub cmdReset_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) _
Handles cmdReset.Click
Dim intX As Integer
Dim objTextBox As TextBox
For intX = 0 To Controls.Count - 1
If TypeOf Controls.Item(intX) Is TextBox Then
objTextBox = Controls.Item(intX)
objTextBox.Text = ""
End If
Next intX
This works fine for any textboxes on my form outside of
groupboxes, The problem is I must also address the
textboxes within the groupboxes.
How do I reference these controls, surely it must be
possible to access controls within groupboxes I'm sure
I'm missing something simple.
Can anyone point me in the right direction... ?
Thanks in advance
Regards Steve...
controls on a form like so...
Private Sub cmdReset_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) _
Handles cmdReset.Click
Dim intX As Integer
Dim objTextBox As TextBox
For intX = 0 To Controls.Count - 1
If TypeOf Controls.Item(intX) Is TextBox Then
objTextBox = Controls.Item(intX)
objTextBox.Text = ""
End If
Next intX
This works fine for any textboxes on my form outside of
groupboxes, The problem is I must also address the
textboxes within the groupboxes.
How do I reference these controls, surely it must be
possible to access controls within groupboxes I'm sure
I'm missing something simple.
Can anyone point me in the right direction... ?
Thanks in advance
Regards Steve...