Hi
I have a form and an SSTab control on the form.
I am trying to add the new functionality of letting the user press control tab and control shift tab to navigate between the different tabs of this SSTab control (just like you can navigate between tabs in Firefox and other applications)
To that end, I have put this code in place:
At first it appears that it works, but very soon, this navigation tool starts to malfunction:
Sometimes this KeyUp method is fired twice (I know this by adding some extra code to display the details on the screen), and even then instead of navigating to two tabs over, it navigates to the previous tab instead of next tab or to two tabs over.
At other times it navigates to an unexpected tab (other than the one expected)
One way to recreate this problem is to navigate between tabs in some other way and THEN press control tab for the next navigation. But the problem can be recreated in other ways too. It happens all the time.
I have used similar code numerous times before in many other applications and defined the functionalities of keys like F5, left arrow, right arrow or some other keys and it always worked without a problem. But I had never before tried this code for defining the functionality of control tab or control shift tab.
I don't know why this technique works perfectly for keys like F5 or left arrow, but not for control tab or control shift tab.
Can you please help.
Thanks.
I have a form and an SSTab control on the form.
I am trying to add the new functionality of letting the user press control tab and control shift tab to navigate between the different tabs of this SSTab control (just like you can navigate between tabs in Firefox and other applications)
To that end, I have put this code in place:
Code:
Private Sub Form_KeyUp(KeyCode As Integer, Shift As Integer)
Dim XKey As String
XKey = "" & KeyCode & "-" & Shift
Select Case XKey
Case "9-2" ' Ctrl Tab
If tabMain.Tab = tabMain.Tabs - 1 Then
tabMain.Tab = 0
Else
tabMain.Tab = tabMain.Tab + 1
End If
Case "9-3" ' Ctrl Shift Tab
If tabMain.Tab = 0 Then
tabMain.Tab = tabMain.Tabs - 1
Else
tabMain.Tab = tabMain.Tab - 1
End If
Case Else
Exit Sub
End Select
End Sub
Sometimes this KeyUp method is fired twice (I know this by adding some extra code to display the details on the screen), and even then instead of navigating to two tabs over, it navigates to the previous tab instead of next tab or to two tabs over.
At other times it navigates to an unexpected tab (other than the one expected)
One way to recreate this problem is to navigate between tabs in some other way and THEN press control tab for the next navigation. But the problem can be recreated in other ways too. It happens all the time.
I have used similar code numerous times before in many other applications and defined the functionalities of keys like F5, left arrow, right arrow or some other keys and it always worked without a problem. But I had never before tried this code for defining the functionality of control tab or control shift tab.
I don't know why this technique works perfectly for keys like F5 or left arrow, but not for control tab or control shift tab.
Can you please help.
Thanks.