How do I set a Radiobutton to default?

Asked

Viewed 2,118 times

2

I have several radiobutton’s. How do I leave one 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 

2 answers

7

To leave a Radiobutton marked just change its Checked property to true. You can do this in the Properties window or via code, for example in the Load event of your form:

private void Form1_Load(object sender, EventArgs e)
{
    seuRadioButton.Checked = true; 
}

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;

Browser other questions tagged

You are not signed in. Login or sign up in order to post.