Posted on 2011-09-27
I'm using the following code to allow the arrow keys (right, left) to act as tab / shift+tab:
Protected Overrides Function ProcessKeyPreview(ByRef m As System.Windows.Forms.Message) As Boolean
Const WM_KEYDOWN As Integer = &H100
If m.Msg = WM_KEYDOWN Then
Select Case m.WParam.ToInt32
Case Keys.Right, Keys.Left
Me.SelectNextControl(Me.ActiveControl, (m.WParam.ToInt32 = Keys.Right), True, True, True)
The problem is the focus moves from a button (either forward or backward) to the next tab index although that control's TabStop property is set to False. The problem does not occur when the focus moves from textbox to textbox or button to button. The tabStopOnly As Boolean condition is set to True.
Any ideas on how to correct the problem?