Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Sendkeys does not work in Windows 7 using VB6

Posted on 2013-01-23
3
Medium Priority
?
11,124 Views
Last Modified: 2013-01-23
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.
0
Comment
Question by:elm9999
  • 2
3 Comments
 
LVL 15

Accepted Solution

by:
eemit earned 700 total points
ID: 38811369
You must use SendInput API
Here is an example.
0
 

Author Comment

by:elm9999
ID: 38811472
Thank you eemit,

I'll use setfocus to the next textbox.
0
 
LVL 15

Expert Comment

by:eemit
ID: 38811652
- 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

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you haven’t already, I encourage you to read the first article (http://www.experts-exchange.com/articles/18680/An-Introduction-to-R-Programming-and-R-Studio.html) in my series to gain a basic foundation of R and R Studio.  You will also find the …
This article will show, step by step, how to integrate R code into a R Sweave document
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Suggested Courses

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question