Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Sendkeys does not work in Windows 7 using VB6

Posted on 2013-01-23
3
Medium Priority
?
10,891 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

670 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