Add SelectedIndexChanged event and then use it to display value in TextBox.
C#
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
this.PopulateCountries();
}
private void PopulateCountries()
{
DataTable dt = new DataTable();
dt.Columns.Add("Id", typeof(int));
dt.Columns.Add("Country", typeof(string));
dt.Rows.Add(1, "United States");
dt.Rows.Add(2, "India");
dt.Rows.Add(3, "Russia");
// Create a new row
DataRow dr = dt.NewRow();
dr["Country"] = "Select";
dr["Id"] = "0";
// Insert it into the 0th index
dt.Rows.InsertAt(dr, 0);
this.cmbCountries.ValueMember = "Id";
this.cmbCountries.DisplayMember = "Country";
this.cmbCountries.DataSource = dt;
}
private void OnSelectedIndexChanged(object sender, EventArgs e)
{
txtValue.Text = cmbCountries.SelectedValue.ToString();
}