Listbox Help

Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Apr 2005
Posts: 75
Reputation: purplegerbil is an unknown quantity at this point 
Solved Threads: 6
purplegerbil's Avatar
purplegerbil purplegerbil is offline Offline
Junior Poster in Training

Listbox Help

 
0
  #1
Jul 17th, 2006
Hi,

A program I am writing has the user entering values into textboxes then clicking an 'Add' button. Once clicked one of the textbox values appears in a list box.

e.g Job Number, Data Filename, Unique Code

The Unique code is displayed in a listbox.
All three values are stored within arrays.

When the user has finished entering details they can save the list. This is to a csv style format.

My question is: Is there a property that can be used to store the array position so when the user saves the info from the listbox, all the related fields are saved as well.

Hope this makes sence.

I have tried the .Tag property but it looks like that only stores one value for the whole listbox.


pG
purpleGERBIL
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 2,413
Reputation: Comatose is a jewel in the rough Comatose is a jewel in the rough Comatose is a jewel in the rough Comatose is a jewel in the rough 
Solved Threads: 211
Team Colleague
Comatose's Avatar
Comatose Comatose is offline Offline
Taboo Programmer

Re: Listbox Help

 
0
  #2
Jul 17th, 2006
There is not one, but a solution is to have another listbox, that's .visible property is set to false, and then have it keep track of whatever value you need it to, to coorespond to the item in the first listbox... I think you want to do though, is use the listindex property of the listbox in the array.... for example print #1, array1(list1.listindex) & "," & array2(list1.listindex) & "," & array3(list1.listindex). This works, because a listbox's first item is 0, and so is an arrays. So, when you populate the listbox, it's indices (slots of the array) line up with the arrays.... with me?
Last edited by Comatose; Jul 17th, 2006 at 9:08 am.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Visual Basic 4 / 5 / 6 Forum
Thread Tools Search this Thread



Tag cloud for Visual Basic 4 / 5 / 6
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC