Hi,
I have several controls on one VB.NET form, which uses the tabindex to set
the focus in the correct order when tab is pressed. However, if "Yes" is
selected in combo1, and tab is pressed then I want to tab straight to
combo3. Otherwise, the tabbing should behave as normal.
Tab isn't detected on KeyPress or KeyDown events, so I tried this...
Protected Overrides Function ProcessTabKey(ByVal forward As Boolean) As
Boolean
If combo1.Focused and combo1.Text = "Yes" Then
Combo3.Focus()
Else
'Return False ??
'MyClass.ProcessTabKey(forward) ??
'Me.ProcessTabkey(forward) ??
End If
End Function
....Which works fine when the focus is on combo1 and the text is "Yes", but
when focus is with any other control, pressing tab doesn't work, i.e. the
focus stays where it is.
I think I need to call the parent class which I've overridden to pass any
other condition to be handled normally, but don't know how.
In the above example, "Return False" does nothing, and the other two cause a
StackOverflow, as it's just calling itself rather than back to the base
class.
I remember in Java you could call "this" to pass back to the parent class.
Setting KeyPreview on the form at design time seems to have no effect either
Any ideas how you do it in VB.NET?
Thanks, Steve