W
W
Hi,
The code below only returns the tabs. I am trying to return the
control on each tab. How can I do that?
Public Sub ClearForm(ByVal CallingForm As Form)
Dim c, tc As Control
For Each c In CallingForm.Controls
If TypeOf c Is TabControl Then
For Each tc In c.Controls
If TypeOf tc Is TextBox Then
tc.Text = ""
ElseIf TypeOf tc Is ComboBox Then
tc.Text = ""
ElseIf TypeOf tc Is RadioButton Then
CType(tc, RadioButton).Checked = False
ElseIf TypeOf tc Is CheckBox Then
CType(tc, CheckBox).Checked = False
End If
Next
End If
Next
End Sub
The code below only returns the tabs. I am trying to return the
control on each tab. How can I do that?
Public Sub ClearForm(ByVal CallingForm As Form)
Dim c, tc As Control
For Each c In CallingForm.Controls
If TypeOf c Is TabControl Then
For Each tc In c.Controls
If TypeOf tc Is TextBox Then
tc.Text = ""
ElseIf TypeOf tc Is ComboBox Then
tc.Text = ""
ElseIf TypeOf tc Is RadioButton Then
CType(tc, RadioButton).Checked = False
ElseIf TypeOf tc Is CheckBox Then
CType(tc, CheckBox).Checked = False
End If
Next
End If
Next
End Sub