Ask Your Question

How do tab stops work with option buttons?

asked 2018-03-24 16:04:13 +0100

ptoye gravatar image

I'm trying to create a dialog with some option buttons, and want to be able to tab through them. I've given them sequential tab stop numbers, but the tab stops don't seem to work: when I tab through the dialog command buttons get selected but the option buttons are ignored. Is this correct? You can try it out by renaming the attachment to a .xdl file and importing it (for some reason you're not allowed to attach .xdl files.


edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted

answered 2018-03-24 16:19:11 +0100

Yes, that's correct. The option button (radiobutton) itself is not a standalone control; a group of option buttons are, since they represent different states of some single property, which can only get one state at a time. The correct way is to define a group (setting the same Group name for all related option buttons), put the same tabstop number to them, and set one of them to Selected state. The group's option button that is selected will be the tab position, and you will be able to change selection using up/down arrow buttons. The "all not selected" configuration is actually invalid, since you cannot recreate it in UI after have selected one. If you need a "not decided" status, then introduce a dedicated option button to the group for that, which could possibly be the one selected by default.

edit flag offensive delete link more


That's interesting - the OO documentation says "Option buttons are grouped through consecutive tab indices only." which to me implies that the tab stops should be sequential. I'll try with having them all the same. I agree with the rest of your comment - thanks.

ptoye gravatar imageptoye ( 2018-03-26 10:41:39 +0100 )edit

Well - the "tab stop order" part could be wrong - please excuse if I misguide here. Wrote by memory - and haven't worked with that for a long time.

Mike Kaganski gravatar imageMike Kaganski ( 2018-03-26 10:59:56 +0100 )edit

The dialog editor won't even let me give two option buttons the same tab number. If I change one, another one automatically changes!

But your comment about using the arrow buttons is spot on. I was trying to use the tab key.

ptoye gravatar imageptoye ( 2018-03-26 11:18:18 +0100 )edit
Login/Signup to Answer

Question Tools

1 follower


Asked: 2018-03-24 16:04:13 +0100

Seen: 30 times

Last updated: Mar 24 '18