Hello I`m fairly new to VB but I`m trying to do my best.
However, sometimes stupid problems like this make me unhappy
I have one tabcontrol and two tabs:
tab1 (default),
tab2
so, I`m trying to set a focus to a text field within the tab2 after I click on tab2, so I use:
So, if I put a breakpoint inside that IF statement and debug my application.
Uppon clicking on the tab2, it WILL enter that scope.
Even if I try to add something to that txtField like txtField.Text = "123" it WILL enter that value.
The only thing it is not doing is the focus. So, what am I doing wrong???
Thanks folks
However, sometimes stupid problems like this make me unhappy
I have one tabcontrol and two tabs:
tab1 (default),
tab2
so, I`m trying to set a focus to a text field within the tab2 after I click on tab2, so I use:
VB.NET:
Private Sub TabControl1_Changed(sender As Object, e As SelectionChangedEventArgs) Handles TabControl1.SelectionChanged
If (tab2.IsSelected) Then
tab2.Focus()
txtField.Text = ""
txtField.Focus()
txtField.SelectAll()
End If
End Sub
So, if I put a breakpoint inside that IF statement and debug my application.
Uppon clicking on the tab2, it WILL enter that scope.
Even if I try to add something to that txtField like txtField.Text = "123" it WILL enter that value.
The only thing it is not doing is the focus. So, what am I doing wrong???
Thanks folks