Reputation: 3181
The problem like this, I have a groupBox which contains two radio buttons, when I run the form, the first radio button get checked immediately, so I tried the following:
None of the above worked with me, any suggestions??
Upvotes: 0
Views: 2723
Reputation: 30872
The intent of a radio button set is to provide choice between a set of distinctive and exhaustive values. That means, that at all times, one and only one radio button should be selected.
If this functionality does not suite your application logic, maybe the logic is flawed, or maybe radio-buttons are not the best UI solution.
As mentioned, a radio button group displays its behavior as soon as any of the radios get focus, which can happen even with just tabbing around the form, so basically the behaviour of the form depends on the user behaving nicely.
Upvotes: 0
Reputation: 4801
You could try setting it to false in the form SHOWN event instead of the form LOAD event as outlined in this question.
Upvotes: 1
Reputation: 55001
As soon as any of the radio buttons get focus it'll be selected, so you need to set initial focus in the form to another control than any of those radio buttons (worst case I suppose you could have a hidden radio button or other control and give that focus, but I'd not recommend it since it looks funny).
Upvotes: 1