View Full Version : putting new list of items in listbox
sandyrepope
11-11-2007, 05:14
In my script I have a listbox with a list of items. I need to let the script put a new list of items in the listbox. I know how to clear the old list but I can't get the new list to be entered in the listbox.
Can anyone help?
Thanks
Sandy
sandyrepope
11-11-2007, 06:32
I am really embarrassed.... I figured out the answer but only after I posted my question.
All I had to do is use the listbox reset to clear the old list and then use a loop and listbox add to put the new list in. It works just as I needed it to.
Sorry about posting too soon. I just hope this information is useful to someone.
Thanks
Sandy
Petr Schreiber
11-11-2007, 09:52
No problem Sandy,
the most simple problems can confuse at first sight sometimes :)
Petr
ErosOlmi
11-11-2007, 12:30
Huuu Sandy, your problem let me think that a new function for LISTBOX and COMBOBOX is needed.
We have:
CONTROL ADD LISTBOX/COMBOBOX ... to add a control and pass an array of items
COMBOBOX/LISTBOX RESET ... to delete the full list
... ADD and DELETE commands to add or delete a single item from the list of items
but ...
no functions to REPLACE the full list with one simple call.
I will think about that.
Thanks
Eros
ErosOlmi
12-11-2007, 16:24
I've changed LISTBOX / COMBOBOX RESET in order to accept a new array of items to replace current one.
So next thinBasic preview will have the following:
LISTBOX RESET hWnd, ctrlID [, NewStringArray()]
COMBOBOX RESET hWnd, ctrlID [, NewStringArray()]
where NewStringArray() is an optional parameter indicating a new array of elements to be loaded instead of current list of items.
Ciao
Eros
sandyrepope
12-11-2007, 17:20
LISTBOX RESET hWnd, ctrlID [, NewStringArray()]
COMBOBOX RESET hWnd, ctrlID [, NewStringArray()]
These two commands will be a big help! ;D They are appreciated!
Thanks
Sandy
Petr Schreiber
12-11-2007, 17:36
Fantastic,
I really like it!
Petr
ErosOlmi
12-11-2007, 17:39
Something to suggest to Power Basic ;)