Visual Basic Development Bookmark and Share   
 Home > Visual Basic General > getting listbox item.
 

getting listbox item.

i have a listbox that contains a series of numbers and i need to be able to take the top listbox item and put it into for example... a textbox.text


http://cid-9f07dcb04e907112.skydrive.live.com/self.aspx/My%20Software/Attributor%202.0.exe
Dmitry Post  6 hours 8 minutes ago
since a ListBox can contain any type of item, you have to use Item.ToString to put into a TextBox


TextBox1.Text = ListBox1.SelectedItem.ToString


or if it is always the first item, use the index


TextBox1.Text = ListBox1.Items(0).ToString
jwavila  6 hours 3 minutes ago
since a ListBox can contain any type of item, you have to use Item.ToString to put into a TextBox


TextBox1.Text = ListBox1.SelectedItem.ToString


or if it is always the first item, use the index


TextBox1.Text = ListBox1.Items(0).ToString
jwavila  6 hours 3 minutes ago

You can use google to search for other answers

Custom Search

More Threads

• Question about My.Settings in VB2005
• Printing Problem
• Adding menu's at runtime problem
• Graphics?
• Unable to cast object of type 'System.Data.SqlClient.SqlParameter' to type 'System.Data.IDataParameter[]'.
• Rate of play with Windows Media Player in Vista
• Developing a middle tier appliation
• MDI Child forms not showing
• Using ComboBox AddRange method with multidimensional arrays
• Globalization problem