Combo Box Value Changed

  • Thread starter Thread starter Jeff Williams
  • Start date Start date
J

Jeff Williams

I have a combobox (has a text display string and value) and two Text
boxes on a form.

Depending on the SelectedValue of the combobox I want to make one or
both of the textboxes readonly.

How can I achieve this.

Regards
Jeff
 
I have a combobox (has a text display string and value) and two Text
boxes on a form.

Depending on the SelectedValue of the combobox I want to make one or
both of the textboxes readonly.

How can I achieve this.

Regards
Jeff

Hi Jeff
you can do this very easyly by adding a SelectedValueChanged event
handler to your combobox like this:

private mycombobox_SelectedValueChanged ( sender e , EventArgs)
{
if ( mycombobox.SelectedValue.ToString() == "Hello")
textbox1.ReadOnly = true;


}

That's All;
 
Back
Top