PDA

View Full Version : Listbox and textbox in vb.net


Mistery1
Jan 23, 2009, 03:56 AM
Hi there,

I wonder if anyone can help. I have a listbox and a textbox. At runtime I already have a list of items in the listbox. When I double click on these items its needs to appear in the textbox. At the moment I have the code that, when I double click on the item in the listbox ONLY one item is added to the textbox. I need to know how to autosize the textbox so that, when I click on many items in the listbox, it should appear in the textbox one below the other.

more2come3
Jan 23, 2009, 05:32 AM
make sure to set the wordwrap property of the textbox to true

on the double click event of the listbox add this code...

textbox1.text = textbox1.text + vbcrlf + listbox1.list(listbox1.listindex)

hope this would help you..

Mistery1
Jan 23, 2009, 05:47 AM
Hi there,

Thanks for helping out, but it does not work. It does not even give me errors

Mistery1
Jan 23, 2009, 08:12 AM
Hi there,

I have the answer. Thanks a lot for you help.