Click here to Skip to main content
15,896,259 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How do I make a datetimepicker editable or non-editable when a radio button is selected in C# for windows application
Posted

Hello ,
Just check whether the radionbutton is checked or not . try this way
if(rad.Checked)
      dtpicker.Enabled = true;
else  
      dtpicker.Enabled = false;


Thanks
 
Share this answer
 
Use Control.Enabled Property[^]
C#
if(yesradioBtn.Checked)
{
    datePicker.Enabled = true;
}
else if(noradioBtn.Checked)
{
    datePicker.Enabled = false;
}


-KR
 
Share this answer
 

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