By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,628 Members | 1,401 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,628 IT Pros & Developers. It's quick & easy.

Option Box Help

P: 2
I am writing a program that works on the selection of one of three option boxes on one form.

When one is selected the verious tasks are carried out.

However, when I return to the option box form, the box that the user selected last time is still highlighted - it has the black circle in it.

Is there anyway of clearing this so that no box is already pre-selected when the form loads?
Mar 25 '07 #1
Share this Question
Share on Google+
7 Replies


Expert 5K+
P: 8,434
I am writing a program that works on the selection of one of three option boxes on one form.

When one is selected the verious tasks are carried out.

However, when I return to the option box form, the box that the user selected last time is still highlighted - it has the black circle in it.

Is there anyway of clearing this so that no box is already pre-selected when the form loads?
What version of VB is this?
Mar 25 '07 #2

P: 2
Visual Basic 6
Mar 25 '07 #3

SammyB
Expert 100+
P: 807
I am writing a program that works on the selection of one of three option boxes on one form.

When one is selected the verious tasks are carried out.

However, when I return to the option box form, the box that the user selected last time is still highlighted - it has the black circle in it.

Is there anyway of clearing this so that no box is already pre-selected when the form loads?
You create another option button, I usually call it OptClear and have it checked in the design mode. Then, set the location so that it is outside of the group box so that the button cannot be seen by the users. You can then "clear" the user's option buttons whenever you want by setting OptClear. A little tricky, but SOP (standard operating procedures).
Mar 26 '07 #4

Expert 5K+
P: 8,434
You create another option button, I usually call it OptClear and have it checked in the design mode. Then, set the location so that it is outside of the group box so that the button cannot be seen by the users. You can then "clear" the user's option buttons whenever you want by setting OptClear. A little tricky, but SOP (standard operating procedures).
Sounds like a useful technique. I have a couple of questions, though:
  • Do you need to turn off TabStop property, or doesn't that apply to option buttons? (I know you can't tab between them, you have to press arrows).
  • How do you deal with the user "arrowing" to the hidden option button?
Mar 26 '07 #5

SammyB
Expert 100+
P: 807
Sounds like a useful technique. I have a couple of questions, though:
  • Do you need to turn off TabStop property, or doesn't that apply to option buttons? (I know you can't tab between them, you have to press arrows).
  • How do you deal with the user "arrowing" to the hidden option button?
Actually, I never thought about anyone using the keyboard to navigate. I don't think it would mess anyone up to allow that because they would never know that the Clear option button was there. However, if it bothers you, you can set TabStop to False and Enabled to False and then they cannot touch it.
Mar 26 '07 #6

Dököll
Expert 100+
P: 2,364
I am writing a program that works on the selection of one of three option boxes on one form.

When one is selected the verious tasks are carried out.

However, when I return to the option box form, the box that the user selected last time is still highlighted - it has the black circle in it.

Is there anyway of clearing this so that no box is already pre-selected when the form loads?
If you are returning to the option box form anyway, why not use:

Expand|Select|Wrap|Line Numbers
  1.  
  2. Unload Me
  3. MyOptionBoxForm.Show
  4.  
  5.  
MyOptionBoxForm being your option form name. This way, the option box form gets back to its original state, thus clearing the last selected user entry. Assuming this what this you hope to achieve...
Mar 27 '07 #7

Expert 5K+
P: 8,434
Actually, I never thought about anyone using the keyboard to navigate. I don't think it would mess anyone up to allow that because they would never know that the Clear option button was there. However, if it bothers you, you can set TabStop to False and Enabled to False and then they cannot touch it.
I've finally had some time to play with this. The TabStop property doesn't appear to make any difference unless the option button is on its own rather than inside a container, so you can probably just ignore it. I thought that disabling the option button would prevent you setting the value in code, but apparently I've just been using MS Access too much lately. (In Access VBA, you can hardly do anything to a disabled control - it's a real pain).

This seems like a nice, elegant solution. Good one!
Mar 27 '07 #8

Post your reply

Sign in to post your reply or Sign up for a free account.