Ask your own question, for FREE!
MIT 6.00 Intro Computer Science (OCW) 24 Online
OpenStudy (anonymous):

Hello, I'm using Visual Basic 2010 to create an invoice and need help displaying the textbox1 input to the listbox. Any suggestions?

OpenStudy (anonymous):

http://bit.ly/11MMMKL

OpenStudy (anonymous):

ListBox1.Items.Add(TextBox1.Text) This is the code I tested and it worked! You may, however, want to add an If statement to this or perhaps a try-catch, otherwise your application may hit an error if the textbox is left empty!

OpenStudy (poopsiedoodle):

Private Function AddText() Listbox1.Items.Add(Textbox1.text) End Function Private Sub Button1_Click(whatever goes in here) Handles Button1.Click AddText() End Sub

OpenStudy (anonymous):

Why bother to call an external function? That wastes cycles...

OpenStudy (poopsiedoodle):

meh. just in case he needs to do it again, he doesn't have to type it all out again, and he can just use the function.

OpenStudy (anonymous):

Good point!

OpenStudy (poopsiedoodle):

oops. It should be Private Sub.

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!