This is what I did to work around this problem. I make a call to WorkaroundTabIndexDefect when my control becomes enabled (on start editing for me.) You will need to remove those handlers at some point too.
Private Sub WorkaroundTabIndexDefect()
For Each ctr As Control In Me.Controls
SetKeyDownHandlers(ctr)
Next
End Sub
Private Sub SetKeyDownHandlers(ByVal ctr As Control)
Dim txtCtr As TextBox = TryCast(ctr, TextBox)
If txtCtr IsNot Nothing Then
txtCtr.AcceptsTab = True
txtCtr.AcceptsReturn = True
Dim evh As KeyEventHandler = New KeyEventHandler(AddressOf WorkaroundKeyDown)
AddHandler txtCtr.KeyDown, evh
Else
ctr.TabStop = False
End If
If ctr.Controls.Count > 0 Then
For Each subCtr As Control In ctr.Controls
SetKeyDownHandlers(subCtr)
Next
End If
End Sub
Private Sub WorkaroundKeyDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyEventArgs)
Try
If Me.ActiveControl IsNot Nothing Then
Select Case e.KeyCode
Case Keys.Return
Dim btnCtr As Windows.Forms.Button = TryCast(Me.ActiveControl, Windows.Forms.Button)
If btnCtr IsNot Nothing Then
btnCtr.PerformClick()
End If
Case Keys.Tab
If e.Shift Then
Me.SelectNextControl(CType(sender, Control), False, True, True, True)
Else
Me.SelectNextControl(CType(sender, Control), True, True, True, True)
End If
End Select
End If
Catch ex As Exception
Trace.WriteLine(ex)
End Try
End Sub