Click here to Skip to main content
15,900,108 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

Is there a way of loading a form with a couple of Radio Buttons without one of them defaulting to checked.

I could do this in VB6 but can't manage it in .Net! even if I put

RadioButton1.checked = False
RadioButton2.checked = False



in the Form Load it still defaults to RadioButton1 being checked.

I want the User to decide which button gets initially checked.

Hope this all make sense, and thanks for your time.
Posted

I personally think that's bad practice. There should always be a default selection on radio buttons. It would be MORE correct to add a radio butotn that simply says "Not selected", and check it by default.
 
Share this answer
 
Thank you, I never thought of it that way.

I have added a new button, made it the default checked button and set it to not visible on the form so the user only has the 2 to choose from.

Objective achieved.

Thanks Again.
 
Share this answer
 
Comments
Scubapro 28-Jul-10 8:01am    
This way, don't forget to implement something if none of 2 is selected. Alternatively, you could use 2 checkboxes (none checked in the beginning) and if one gets selected (=true) set the other one to false and vice versa.
98fireblade 28-Jul-10 8:03am    
The only option available is Exit until a button is selected.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900