Sendkeys does not work in Windows 7 using VB6

Hi guys,

I was working fine programming with VB6 in Windows XP but since I changed my computer to Windows 7 and try to run my application I get this Error: Run time error 70: Permission Denied, this happend when i use SENDKEYS from a textbox, the way i use it is this:

Private Sub txtNombre_KeyDown(KeyCode As Integer, Shift As Integer)
Select Case KeyCode
        Case vbKeyDown, vbKeyReturn
            Sendkeys "{TAB}"
        Case vbKeyUp
            Sendkeys "+{TAB}"
    End Select
End Sub

Is there any way to fix this?

Thank you so much guys.
elm9999Asked:
Who is Participating?
 
eemitConnect With a Mentor Commented:
You must use SendInput API
Here is an example.
0
 
elm9999Author Commented:
Thank you eemit,

I'll use setfocus to the next textbox.
0
 
eemitCommented:
- The tab order is the order in which a user moves focus from one control to another by pressing the TAB key.
- Tab order can be set in the Properties window using the TabIndex property.
- By turning off the TabStop property, you can make a control be passed over in the tab order of the form.
You don't need Sendkeys for that!
0
All Courses

From novice to tech pro — start learning today.