tags:

views:

51

answers:

3
A: 

You need to hook up the SelectedIndexChanged event. Depending on whether this is a WinForms or Web App will determine the exact code but ultimately they're pretty much the same.

Daz Lewis
+5  A: 

You need to subscribe to SelectionChanged event of your ComboBox, then in eventhandler method use the following

if (comboBox.SelectedItem == null) 
{
   textBox.Text = string.Empty; //or any default value
   return;
}
textBox.Text = comboBox.SelectedValue.ToString();
Eugene Cheverda
A: 

I think you can use binding to do that.

txtbox.DataBindings.Add("Text", comboBox, "Text")
Bruno Costa