Skip to content
Loading
  • Rijwan Ansari
    +2
     You can simply add condition in radiobtn event do checked true or false of check box.
    +2
  • Satya Karki
    +2
    Hi, Simply write below code
     
    1. private void radioButton1_CheckedChanged(object sender, System.EventArgs e)    
    2.   {    
    3.     
    4.         if (radioButton1.Checked == true)    
    5.         {    
    6.            checkBox1.Checked=true;    
    7.         }             
    8.   }    
     
    +2
  • Rijwan Ansari
    +2
    Try this way
     
    Replace radio button id and checkbox id based on your code. 
    1. private void radioButton1_CheckedChanged(object sender, System.EventArgs e)        
    2. {       
    3.         if (radioButton1.Checked == true)        
    4.         {        
    5.            checkBox1.Checked=true;        
    6.         }    
    7.     else if (radioButton1.Checked == false)        
    8.         {        
    9.            checkBox1.Checked=false;        
    10.         }                
    11. }    
     
    +2
  • Sachin Singh
    +1
    can you plese explain more,
    you have radio buttons and checkboxes and you want to check the checkboxes on click of a radio button , but then what is the condition?
    +1
  • Siddharth Gajbhiye
    +1
    Hello PK
     
    In this case if you click on radio button then on that condition you should fire an event to check the checkbox automatically . 
    +1
  • +1
    thanks for reply 
    +1
  • Harsh Shah
    -2
    Just simply add the below line for the checkbox checked
    1. private void Form1_Load(object sender, EventArgs e)
    2. {
    3.    Mycheckbox1.AutoCheck = true;
    4. }
    And the below code for Radiobutton
    1. private void Form1_Load(object sender, EventArgs e)
    2. {
    3.    RadioButton.Checked = true;
    4. }
    -2