listbox search

  • Thread starter Thread starter Hrvoje Voda
  • Start date Start date
H

Hrvoje Voda

I'm going through the listbox items with cursor.

I would like to put the selected listbox text into a textbox.

What method should I use?

Hrcko
 
Hello,

You can try to use SelectedIndexChanged event of ListBox.


listBox.SelectedIndexChanged += new
System.EventHandler(this.listBox_SelectedIndexChanged);

private void listBox_SelectedIndexChanged(object sender, System.EventArgs e)
{
textBox.Text = listBox.SelectedItem.ToString( );
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

ckecked listbox 4
remove from listBox 3
checked listbox check all 3
Access Cannot select items in listbox 1
Problem with WPF ListBox 5
class 3
check disabled 3
Property FormatString for ListBox 1

Back
Top