Theses functions are the typical one used for dealing with a listbox, why not including them in the ppl ?
This could decrease the amount of code to write by the user again

Functions: AddItem, RemoveItem, ReplaceItem, Select, GetSelected, ClearList, Load from a list, load from a file.
Some more will follow probably.
Listbox Usage:
Load an item in a listbox:
func AddItem(listbox$, editbox$)
text$ = GetText(editbox$);
where$ = SendMessage(listbox$, LB_GETCOUNT, 0, 0);
SendMessage(listbox$, LB_ADDSTRING, where$, text$);
Return(true);
end;
AddItem(LISTBOX101$,EDIT105$);
Get current selected item from a listbox:
func GetSelItem(listbox$, editbox$)
where$ = SendMessage(listbox$, LB_GETCURSEL, 0, 0);
text$ = GetItem(listbox$, where$);
SetText(editbox$, text$);
Return(true);
end;
GetSelItem(LISTBOX101$,EDIT105$);
Delete an item from a listbox:
func DelItem(listbox$)
where$ = SendMessage(listbox$, LB_GETCURSEL, 0, 0);
SendMessage(listbox$, LB_DELETESTRING, where$, 0);
Return(true);
end;
DelItem(LISTBOX101$);
Update an item in a listbox:
func UpdateItem(listbox$, editbox$)
text$ = GetText(editbox$);
where$ = SendMessage(listbox$, LB_GETCURSEL, 0, 0);
SendMessage(listbox$, LB_DELETESTRING, where$, 0);
SendMessage(listbox$, LB_INSERTSTRING, where$, text$);
//SendMessage(listbox$, LB_SETCURSEL, where$, text$); ?? is that functionnal for a replace ??
Return(true);
end;
UpdateItem(LISTBOX101$,EDIT105$);
Select All item in list:
func SelAllItem(listbox$)
where$ = SendMessage(listbox$, LB_GETCOUNT, 0, 0);
i$=0;
Repeat
SendMessage(listbox$, LB_SETSEL, i$, i$);
i$++;
Until(i$>=where$);
SendMessage(listbox$, LB_SETSEL, 1, 0);
Return (true);
end;
SelAllItem(LISTBOX101$);
Load Listbox from a list:
func list_to_listbox(listbox$, list$)
i$=0;
scount$ = Count(list$);
while (i$ < scount$)
SendMessage(listbox$, LB_ADDSTRING, i$, list$);
Next(list$);
i$++;
end;
end;
list_to_listbox(LISTBOX101$, list$);
Clear listbox content:
func ClearList(listbox$)
SendMessage(listbox$, LB_RESETCONTENT, 0, 0);
end;
ClearList(LISTBOX101$);
Load Listbox from a file:
func file_to_listbox(listbox$, Filename$)
s$ = LoadStr(Filename$, i$);
List(slist$);
StrToList (s$, "\n", slist$);
i$=0;
scount$ = Count(slist$);
while (i$ < scount$)
SendMessage(listbox$, LB_ADDSTRING, i$, slist$);
Next(slist$);
i$++;
end;
end;
file_to_listbox(LISTBOX101$, "\\My Documents\\ListBox1.txt");