M
Mobileboy36
Hi group,
I have got a custom textbox class.
How can I cancel/Block the TABKEY, to avoid a user can exit the the custom
textbox.
Please don't propose to set tabstop from the other controls to false because
can't do that for certain reasons.
I already tried this code INSIDE my custom textbox class:
Protected Overrides Sub OnKeyPress(ByVal e As
System.Windows.Forms.KeyPressEventArgs)
If e.KeyChar = Chr(System.Windows.Forms.Keys.Tab) Then
e.Handled = True
Else
e.Handled = False
MyBase.OnKeyPress(e)
End If
End Sub
Protected Overrides Sub OnKeyDown(ByVal e As
System.Windows.Forms.KeyEventArgs)
If e.KeyCode = System.Windows.Forms.Keys.Tab Then
e.Handled = True
Else
e.Handled = False
MyBase.OnKeyUp(e)
End If
End Sub
It does not work. How can I achieve my purpose?
Best regards,
Mobile boy
I have got a custom textbox class.
How can I cancel/Block the TABKEY, to avoid a user can exit the the custom
textbox.
Please don't propose to set tabstop from the other controls to false because
can't do that for certain reasons.
I already tried this code INSIDE my custom textbox class:
Protected Overrides Sub OnKeyPress(ByVal e As
System.Windows.Forms.KeyPressEventArgs)
If e.KeyChar = Chr(System.Windows.Forms.Keys.Tab) Then
e.Handled = True
Else
e.Handled = False
MyBase.OnKeyPress(e)
End If
End Sub
Protected Overrides Sub OnKeyDown(ByVal e As
System.Windows.Forms.KeyEventArgs)
If e.KeyCode = System.Windows.Forms.Keys.Tab Then
e.Handled = True
Else
e.Handled = False
MyBase.OnKeyUp(e)
End If
End Sub
It does not work. How can I achieve my purpose?
Best regards,
Mobile boy