Solved

KeyCode

Posted on 2000-04-18
6
374 Views
Last Modified: 2012-05-04
Is there a way to find the KeyCode when we don't know where is the focus. I don't want to use SetFocus. I just want to catch the KeyCode Anytime.
If it is possible without Api i'd like?
0
Comment
Question by:dosyl
  • 3
  • 2
6 Comments
 
LVL 2

Expert Comment

by:Sage020999
ID: 2728419
Are you talking about monitoring which keys are pressed in your app?  You can turn on the keypreview for the form.  
0
 
LVL 1

Author Comment

by:dosyl
ID: 2728560
I want to verify for example:
If the user press Delete, i will delete the info. on the form. Etc.
0
 
LVL 1

Author Comment

by:dosyl
ID: 2728567
Info.= Data in txtboxes, data in the recordset etc.
0
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 
LVL 2

Accepted Solution

by:
Sage020999 earned 10 total points
ID: 2728604
Ok,  turn on your keypreview for the form.  This will send the keypreview property of the form.  This will force the keys to affect the form and not the controls on the form.  You can then validate the keys in the Keyup or Keydown events to involk the differant responses you wish to create.
0
 

Expert Comment

by:korky
ID: 2730719
Use the GetAsyncKeyState() API


0
 
LVL 1

Author Comment

by:dosyl
ID: 2730821
I forgot this property.
Thank you.
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

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…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

708 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now