G
Guest
Hello,
I have 3 textboxes and 1 combobox on a form. On entering the control I want
to select all the text. I can make an array of textboxes like this:
Dim arrTxt As TextBox() = {txt1, txt2, txt3}
Then I loop through that array
Private Sub onEntering(ByVal sender As Object, ...) Handles _
txt1.Enter,
txt2.Enter, txt3.Enter
CType(sender, TextBox).SelectAll()
End Sub
Is it possible to create a similar control array that I could stuff the
textboxes and the combobox into? If yes, how is this done? What kind of
control object could I use to hold different controls? And how do I check if
sender is a
Textbox or combobox?
If CType(sender, TextBox) = True Then...? is this doable?
If CType(sender, ComboBox) = True Then...?
Thanks,
Rich
I have 3 textboxes and 1 combobox on a form. On entering the control I want
to select all the text. I can make an array of textboxes like this:
Dim arrTxt As TextBox() = {txt1, txt2, txt3}
Then I loop through that array
Private Sub onEntering(ByVal sender As Object, ...) Handles _
txt1.Enter,
txt2.Enter, txt3.Enter
CType(sender, TextBox).SelectAll()
End Sub
Is it possible to create a similar control array that I could stuff the
textboxes and the combobox into? If yes, how is this done? What kind of
control object could I use to hold different controls? And how do I check if
sender is a
Textbox or combobox?
If CType(sender, TextBox) = True Then...? is this doable?
If CType(sender, ComboBox) = True Then...?
Thanks,
Rich