Capture arrow key press when an option group has the focus 
Author Message
 Capture arrow key press when an option group has the focus

I have just spent ages working out how to capture the Tab key for use
in keydown/keypress events with forms. Now I would like to be able to
capture the up/down arrow keys.

When a textbox has the focus this is no problem, however when an option
button has the focus, it captures the key press and uses it to move to
the next option buttion in the group. When the last button in the group
is reached, it switches focus to another control. I don't want this to
happen, so I am attempting to write my own on keydown event.

Any suggestions?

Sent via Deja.com http://www.*-*-*.com/
Before you buy.



Sat, 15 Mar 2003 11:50:17 GMT  
 Capture arrow key press when an option group has the focus
Try something like this, I haven't tried it but it should work:

Pseudo code......

In the Key_Down Event

If KeyCode = MyKeyCode Then

    KeyCode = 0

    DoActionForMyKeyCode

End If

or

in Key_Press Event

If KeyAscii = MyKeyAscii Then

    KeyAscii = 0

    DoActionForMyKeyAscii

End If


Quote:
> I have just spent ages working out how to capture the Tab key for use
> in keydown/keypress events with forms. Now I would like to be able to
> capture the up/down arrow keys.

> When a textbox has the focus this is no problem, however when an option
> button has the focus, it captures the key press and uses it to move to
> the next option buttion in the group. When the last button in the group
> is reached, it switches focus to another control. I don't want this to
> happen, so I am attempting to write my own on keydown event.

> Any suggestions?

> Sent via Deja.com http://www.deja.com/
> Before you buy.



Wed, 18 Jun 1902 08:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Scalextric car model - capturing arrow key presses

2. Capturing Arrow Keys when Focus is Set to a Command Button

3. Trap cursor/arrow key presses

4. Detecting Keypress if Arrow Keys are pressed

5. ****Getting a Sprite To Move When You Press An Arrow Key****

6. option button arrow key events

7. Capturing arrow key events for labels

8. capturing arrow keys in listview control

9. Resolved: MDI Focus/Arrow key problem

10. Need help with MDI Focus/Arrow key prob

11. MSFlexGrid - Capturing Arrow keys

12. How capture arrow keys from a MsFlexGrid

 

 
Powered by phpBB® Forum Software