I'm trying to index through an array of controls, I can find the control I am looking for. However, when I try to interact with the control, .Net doesn't seem to understand the control I am referencing.
It works fine if the control is textbox, but in this case it is a combobox. Am I missing something.
Here's my code:
Dim i, j As Integer
For i = 0 To (TabControl2.TabCount - 1)
If TabControl2.TabPages(i).Name.IndexOf(tabName) <> -1 Then
For j = 0 To (TabControl2.TabPages(i).Controls.Count - 1)
If TabControl2.TabPages(i).Controls(j).GetType.ToString.IndexOf("ComboBox"
<> -1 Then
MsgBox("Found the combo box: " & TabControl2.TabPages(i).Controls(j).Name.ToString)
'Now, let's set the combobox selectedindex
'This is where it breaks. .Net throws a compilation error here
TabControl2.TabPages(i).Controls(j).selectedIndex = 1
End If
Next
End If
Next --------------------------------------
Is George Lucas Kidding...
Noise Core: 7.62
It works fine if the control is textbox, but in this case it is a combobox. Am I missing something.
Here's my code:
Dim i, j As Integer
For i = 0 To (TabControl2.TabCount - 1)
If TabControl2.TabPages(i).Name.IndexOf(tabName) <> -1 Then
For j = 0 To (TabControl2.TabPages(i).Controls.Count - 1)
If TabControl2.TabPages(i).Controls(j).GetType.ToString.IndexOf("ComboBox"
MsgBox("Found the combo box: " & TabControl2.TabPages(i).Controls(j).Name.ToString)
'Now, let's set the combobox selectedindex
'This is where it breaks. .Net throws a compilation error here
TabControl2.TabPages(i).Controls(j).selectedIndex = 1
End If
Next
End If
Next --------------------------------------
Is George Lucas Kidding...
Noise Core: 7.62