[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 406
  • Last Modified:

Substitute Tab key...

Dear experts...
What i'm trying to do is rather easy, but for some reason i'm not very succesfull achiving it...

What i'm attempting to do is make the Ctrl-(LeftArrow) combination pass the  focus between the controls on the window just like the "Tab" key does...

I would really appreciate your help.
Thank you...

0
asaflahv1
Asked:
asaflahv1
  • 2
1 Solution
 
manojaminCommented:
'do this
' set Form1.KeyPreview = True in property window

Private wasControl As Boolean
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
    If (KeyCode = vbKeyControl And Not wasControl) Then
        wasControl = True
    End If
End Sub
Private Sub Form_KeyUp(KeyCode As Integer, Shift As Integer)
    If (KeyCode = vbKeyLeft And wasControl) Then
        wasControl = False
        Debug.Print "this is whare you detect that this is ""Ctrl+<-"""
    End If
End Sub
0
 
manojaminCommented:
'oh! change this as shown...

Private Sub Form_KeyUp(KeyCode As Integer, Shift As Integer)
    If (KeyCode = vbKeyLeft And wasControl) Then
        Debug.Print "this is where you detect that this is ""Ctrl+<-"""
    End If
    wasControl = False
End Sub
0
 
KDivadCommented:
In form_Keyup:

If KeyCode = vbKeyLeft And Shift = vbKeyControl Then
    KeyCode = 0
    Shift = 0
    SendKeys "{Tab}"
End If
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now