I have 8 different scripts that use the same large 200+ list of items in a ComboBox, I've been maintaining manually.
There must be a way to maintain just a single file and use it in my ComboBoxes.
I found the "ListText" properties for the ComboBox and added the full path of the file I want to use.
I'm lacking the knowledge of what and where to modify my code.
I did search the forum and found a few posts, but none were detailed enough.
If anyone knows of any articles or videos that relate to this issue please forward them.
How to use a text file to populate a ComboBox
Moderators: JRL, Dorian (MJT support)
-
- Pro Scripter
- Posts: 132
- Joined: Mon Dec 22, 2008 4:56 pm
- Location: St Augustine FL
How to use a text file to populate a ComboBox
Thank you in advance for all your help
Gil
Gil
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Re: How to use a text file to populate a ComboBox
ListText needs a string, with each item separated by line breaks, so all you need to do is read the text file into a string and add that to ListText:
ReadFile>c:\bla\items.txt,strTheItems
SetDialogProperty>Dialog1,Combo1,ListText,strTheItems
ReadFile>c:\bla\items.txt,strTheItems
SetDialogProperty>Dialog1,Combo1,ListText,strTheItems
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
-
- Pro Scripter
- Posts: 132
- Joined: Mon Dec 22, 2008 4:56 pm
- Location: St Augustine FL
Re: How to use a text file to populate a ComboBox
Marcus,
I had a few issue of where the code was added, but figured it out.
Thanks for your input
Gil
I had a few issue of where the code was added, but figured it out.
Thanks for your input
Gil
Thank you in advance for all your help
Gil
Gil