PDA

Click to See Complete Forum and Search --> : Extracting data from listbox


bas
Dec 7th, 1999, 12:26 AM
Hello!
I'm using VB6.0 working model at home
and have a question about listboxes. How can I extract info from the listbox and transfer
it to textboxes. The program requires that the user enter info into 5 diff texboxes and
hit an add cmd button to transfer the contents into the listbox.Then, when user selects a line from the listbox,the contents
in that line should transfer back to the corresponding textboxes. Someone told me to
use the SPLIT function. Any help will be
appreciated.
THANKS.

Juillet
Dec 7th, 1999, 01:19 AM
in the list box click event just put your code to do what you want.
List1_Click()
ie...text1.text = list1.text

Serge
Dec 7th, 1999, 01:45 AM
This example would assume that you have a Control array for TextBoxes.

To insert into a ListBox

Dim i As Integer

For i = 0 To Text1.Ubound
List1.AddItem Text1(i).Text
Next


Put this on double click event of the ListBox

Text1(List1.ListIndex).Text = List.List(List1.ListIndex)


------------------

Serge

Software Developer
Serge_Dymkov@vertexinc.com
Access8484@aol.com
ICQ#: 51055819 (http://www.icq.com/51055819)