Click here to Skip to main content
15,886,806 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I make 3 radiobutton in a groupbox. User select any one of radiobutton at run time. But when form load,the first radiobutton is checked default; This same problem arise for Quiz Project:Question with 4 no of radiobutton.Plz Help to Resolve this problem.
Posted
Comments
Sergey Alexandrovich Kryukov 7-Jul-14 13:13pm    
RadioButton? Which one? Full type name, please, before we even can talk...
And please don't expect anyone to read your hard drive to see what did you screw up. Code sample, please, complete but short, and steps to reproduce the problem.
—SA

Set the Check status of each RadioButton in the Form_Load event
VB
rbOne.Checked = False
or
VB
rbOne.CheckState = CheckState.Unchecked
.

Although I haven't been in this situation, there is a possibility that the IDE will automatically assume that at least one of the RadioButtons should be Checked since they are all grouped together in a single control, in this case a GroupBox.

The "Tab Index" controls only the Tab sequence - the order in which the cursor will jump from one control to the next when the TAB key is pressed. However I am not sure if it will determine if a RadioButton should be checked or not.
 
Share this answer
 
to be only concern to your problem..just open that window where this radiobuttons are. select every radiobuttons and change checked property to false.
 
Share this answer
 
Hi, in this case you have to manually set all RadioButton objects to
RadioButton.Checked = False in the Form_Shown event.

 
Share this answer
 
v4
Comments
Atyant Srivastava 7-Jul-14 13:59pm    
It is due to the TAB index,you might have AutoCheck set to True, simply put lowest TAB index to some other control and your radio button would not be selected by default.
This is just the another way.

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