views:

43

answers:

3

in my window application i have list box. when i select any of the item in listbox i have to display in text box that particular item please help me

+1  A: 

Use this

textBox.Text = listBox.SelectedItem.ToString();
Sauron
A: 

You can handle the SelectedIndexChanged event like this:

private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
{
    textBox1.Text = ((ListBox) sender).SelectedItem.ToString();
}
sgrassie
A: 

it is simple yar.

textBox1.Text=listBox1.SelectedItem.ToString();
Cute