enable a textbox when a radio button is checked to enter data there

master_2013

Active member
Joined
Jul 8, 2013
Messages
41
Programming Experience
Beginner
i want to enable a text box which is disable as the form starts but when i checked the radio button it is automatically enabled to enter data there?????????????????????????
 
Handle the CheckedChanged event of the RadioButton and, in the event handler, get the value of the Checked property of the RadioButton. If the RadioButton is checked then set the Enabled property of the TextBox to True.

Importantly, you need to also decide whether you want to disable the TextBox again if the RadioButton is unchecked. If you do then you need to set the Enabled property of the TextBox to False again. In that case, the simplest option is to simply assign the value of the Checked property of the RadioButton directly to the Enabled property of the TextBox.
 
Back
Top