J
J L
I am trying to step through the controls on a form and take some
action when I find a specific type. I dont know how to express this in
an If or Select clause.
I tried:
Dim Ctrl As Control
For Each Ctrl In Me.Controls
If Ctrl.GetType = System.Windows.Forms.TextBox Then
<take some action>
End If
Next
and
Select Case Ctrl.GetType
Case System.Windows.Forms.TextBox
<take some action>
End Select
In both cases it says the System.Windows.Forms.TextBox type can not be
used in an expression. So how am I to do this compare?
TIA,
John
action when I find a specific type. I dont know how to express this in
an If or Select clause.
I tried:
Dim Ctrl As Control
For Each Ctrl In Me.Controls
If Ctrl.GetType = System.Windows.Forms.TextBox Then
<take some action>
End If
Next
and
Select Case Ctrl.GetType
Case System.Windows.Forms.TextBox
<take some action>
End Select
In both cases it says the System.Windows.Forms.TextBox type can not be
used in an expression. So how am I to do this compare?
TIA,
John