Solved

CheckBox Up/Down intercept

Posted on 1998-12-17
1
132 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

Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

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

Suggested Solutions

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…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
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…

809 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