Hi,
Is there a way to add item to a list box (know how to do this)
and have that new item remain in the listbox next time the App is loaded ?
Thanks in advance.
Printable View
Hi,
Is there a way to add item to a list box (know how to do this)
and have that new item remain in the listbox next time the App is loaded ?
Thanks in advance.
You need to store the information somewhere. So store the listitems in a file, or in the registry.
The registry would probably be easiest. Try using SaveSetting() and GetSetting()
Either the registry or a database. Code can't store once the program is closed. Registry will probably be the easiest. Database be better if your going to run the app on mulitple machines and need the same info.
Click the Use SaveSetting and GetSetting to store and retrieve data from the Registry link in my signature.Quote:
Originally posted by plenderj
...The registry would probably be easiest. Try using SaveSetting() and GetSetting()
I'd suggest putting the data in a UDT, you could take other info as well this way(checked, tags, etc).
As a UDT, Binary read/write access will do most the work for you!
VB Code:
Private Type tList lstText as String lstChecked as Boolean lngTag as Long End Type Private List() as tList Open file for Binary as #1 Put 1,, List Close #1
The only problem here is knowing the number of records.
You could either loop til EOF, redimming along the way. Or write a long with the number of indices at the start of the file. Read it, set bounds, and do it in one chunk(probably faster).