Solved

CheckBox Up/Down intercept

Posted on 1998-12-17
1
131 Views
Last Modified: 2013-12-26
The CheckBox control captures Up and Down keypresses and
treats them as BackTab and Tab.  I want to capture Up and
Down keypresses myself, but they don't make it through
to a KeyDown event procedure.

Does anyone know if/how I can pursuade a checkbox to leave
Up & Down keypresses alone?
(I'm working with VB 5 pro)
0
Comment
Question by:menicoll
1 Comment
 
LVL 3

Accepted Solution

by:
myqlG earned 100 total points
ID: 1489059
Since windows itself is intercepting the arrow keys and setting
focus elsewhere the only way you can capture that is with a
msghook of some kind.. and not natively from VB.
However.. a really really bad workaround (and IM almost
ashamed to post it here) is:
1 make a variable public as integer (k)
2. in keydown set k=0 then k=keycode
3 on lostfocus..check to see what k=
if k=some num (use a select case) then it wasnt because
of arrow keys..
if k=0 THEN it MAY have been an arrow key.

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…

895 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

15 Experts available now in Live!

Get 1:1 Help Now