-
May 13th, 2021, 03:03 AM
#1
Thread Starter
Addicted Member
Setting option buttons to false
I have a form with two option buttons. I attempt to set them both to false in the load event. However the first one is always true when the form loads. When these same two options buttons are set to false later in the code they both go false as intended. These are the only option buttons on the form.
If they both go false later in the program, why won't they do that in the load event?
-
May 13th, 2021, 03:32 AM
#2
Re: Setting option buttons to false
can we see your code ? (the load event one). You can also set them to false in the designer.
The best friend of any programmer is a search engine
"Don't wish it was easier, wish you were better. Don't wish for less problems, wish for more skills. Don't wish for less challenges, wish for more wisdom" (J. Rohn)
“They did not know it was impossible so they did it” (Mark Twain)
-
May 13th, 2021, 03:33 AM
#3
Re: Setting option buttons to false
Presumably you mean RadioButtons. It's a good idea to use the correct names for things to avoid confusion.
The issue is that one of your RadioButtons is the first control in the Tab order. The first selectable control in the Tab order always gets focused by default when the form loads and a a RadioButton gets checked when it receives focus.
If you wanted to use code to uncheck that RadioButton then you would have to do it in the Shown event handler, not the Load event handler. Alternatively, change the Tab order so that RadioButton is not first.
-
May 13th, 2021, 04:40 AM
#4
Thread Starter
Addicted Member
Re: Setting option buttons to false
Originally Posted by jmcilhinney
Presumably you mean RadioButtons. It's a good idea to use the correct names for things to avoid confusion.
The issue is that one of your RadioButtons is the first control in the Tab order. The first selectable control in the Tab order always gets focused by default when the form loads and a a RadioButton gets checked when it receives focus.
If you wanted to use code to uncheck that RadioButton then you would have to do it in the Shown event handler, not the Load event handler. Alternatively, change the Tab order so that RadioButton is not first.
Yes I meant Radio Buttons. I learned VB on VB 6 and still use some of the terms I originally learned.
Thanks that did it. Did not think of the tab order. Sometimes the simplest things!
-
May 13th, 2021, 10:35 AM
#5
Re: Setting option buttons to false
It was RadioButtons back then, too. The term is ancient!! Nobody has REAL radio buttons (buttons like that on their radio) anymore, though some of us did back in the day. Option Buttons is a far better name, in my opinion, so if you encountered that, you probably encountered it from somebody who shared my opinion.
My usual boring signature: Nothing
-
May 13th, 2021, 10:42 AM
#6
Re: Setting option buttons to false
Originally Posted by Shaggy Hiker
It was RadioButtons back then, too.
In VB 6.0 IDE
ToolTip says "OptionButton"
Default name is "Option1"
Default caption is "Option1"
Help describes it as "OptionButton Control"
-
May 13th, 2021, 07:47 PM
#7
Re: Setting option buttons to false
Originally Posted by Shaggy Hiker
It was RadioButtons back then, too. The term is ancient!! Nobody has REAL radio buttons (buttons like that on their radio) anymore, though some of us did back in the day. Option Buttons is a far better name, in my opinion, so if you encountered that, you probably encountered it from somebody who shared my opinion.
I would agree that RadioButton isn't necessarily the best name as far as being descriptive, given how many people probably have no clue about the origin of the name. That said, the name is the name and, if you use the name, there can be no confusion. there's every chance that someone else might decide that "option button" is an appropriate name for something else, and thus confusion has been sown. If we always use the actual names of things, we always know exactly what we're talking about. I'm not implying that you were suggesting otherwise, but I'm just clarifying my position.
-
May 14th, 2021, 03:03 AM
#8
Re: Setting option buttons to false
Originally Posted by jmcilhinney
I would agree that RadioButton isn't necessarily the best name as far as being descriptive, given how many people probably have no clue about the origin of the name.
If I remember correctly, they had a square shape at that time not a round one...
The best friend of any programmer is a search engine
"Don't wish it was easier, wish you were better. Don't wish for less problems, wish for more skills. Don't wish for less challenges, wish for more wisdom" (J. Rohn)
“They did not know it was impossible so they did it” (Mark Twain)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|