How do I leave a RadioButton marked as default?

2

I have several radioButton's. How do I leave a marked as default?

private void radioButton2_CheckedChanged(object sender, EventArgs e)
{   
    comboBox4.Visible = false;
    comboBox5.Visible = false;
    comboBox6.Visible = false;
    comboBox7.Visible = false;
}// RadioButton.Checked 
    
asked by anonymous 14.03.2014 / 22:21

2 answers

7

To leave a RadioButton checked, just change its Checked property to true . You can do this in the Properties window or via code such as the Load event of your form:

private void Form1_Load(object sender, EventArgs e)
{
    seuRadioButton.Checked = true; 
}
    
14.03.2014 / 22:43
0

There is a property in the component itself: Cheked (true or false)

private void radioButton2_CheckedChanged(object sender, EventArgs e) {
    comboBox4.Visible = false;
    comboBox5.Visible = false;
    comboBox6.Visible = false;
    comboBox7.Visible = false;
}// RadioButton.Checked
    Radio4.Cheked = true;
    Radio5.Cheked = true;
    Radio6.Cheked = true;
    Radio7.Cheked = true;
    
19.03.2014 / 21:32