@John Anthony Oliver and Cor Lighthert: You can prevent the "Tab key focuses next control" behavior by setting TextBox.AcceptsTab = True. This is not unpredictable behaviour. The tab key was originally intended to indent text and
works this way in all text processing software.
@JB Brossard: I just tested JohnWein's code. Works like a charm.
@JohnWein: Thanks for the tip!
Would you believe it, all this time I've been using Vb.Net ( since around 2003 - 2004 )
and not even looked at AcceptsTab for a TextBox.
Thanks for your input to this thread. :-)
I should have used Ctrl + Tab in my code instead like this as of course
Shift + Tab
goes to the previous control and Alt + Tab switches between active applications.>>
Public Class Form1
Private Sub TextBoxes_KeyDown _
(ByVal sender As Object, _
ByVal e As System.Windows.Forms.KeyEventArgs) _
Handles TextBox1.KeyDown, TextBox2.KeyDown, TextBox3.KeyDown
If e.Modifiers = Keys.Control And e.KeyCode = Keys.Tab Then