is there a way to use keyboard to select from an option group?

AnnusHorribilis

Registered User.
Local time
Today, 03:46
Joined
Apr 12, 2005
Messages
13
I have a user who can't operate a mouse and I want to make it possible for him to select from an option group using only the keyboard.This is possible if a default button is stipulated, but can it be done when there is no default?

There is no event associated with the keyboard in an option group, only with the controls within it. I tried using the Got Focus event on an option Button, but entering the control doesn't cause the options to receive the focus, seemingly.

Any ideas, (they don't have to be fully formed) would be gratefully accepted.
 
Can't he Tab around the option group?
 
Apparently not...

... because the form is set up with tab stops that take him from one field to the next in sequence. Pressing the tab key within the option group takes him to the next field, not through the option group.

The arrow keys will toggle through the options, but only if a default is set or if a selection is made with the mouse first - thus defeating the object. I thought of using SendKeys, but I can't find an event to latch on to.

Perhaps a subroutine is the answer, but my present skill level won't run to it.
 
Of course...

...it is possible to use the arrow keys, but to select the first option you have to move to any other option and then back to the first, which introduces the possibility of errors. I'd rather use the appropriate keys if possible.
 
You can hit space to select the first option, I believe, when focus is within the option group.

Additionally, if you add an ampersand (&) within the caption of the individual options, this may serve as a shortcut for selecting from anywhere on the form.
 
Well, blow me!

Where is that gem of information documented? It solves my problem at a stroke! Thanks Roy-vidar, for coming up with that.
 
AnnusHorribilis said:
Where is that gem of information documented?

I don't know if it's documented but the Alt + underscore letter is common throughout Windows. Most applications make use of it.

If you use the & in a caption and want to represent an actual ampersand then you need to use &&.
 
Thanks, I knew about &&, though not about the &_ . I didn't know the spacebar tip. I lashed out wildly at every function key in sight, but the very big key under my nose got forgotten.

You've guessed I'm not a professional, haven't you? :D
 

Users who are viewing this thread

Back
Top Bottom