John-oh
11-03-2003, 11:42 AM
I am using a ListBox to open various (predefined) files.
I am using a suggested script (modified) from the help files "how do I?"
I have a ListBox with a button underneath, with the following code 'on press'
selected = ListBox.GetSelectedCount("ListBox1");
file = ListBox.GetItemData("ListBox1", selected);
if file == "" then
Dialog.Message("Notice", "You must select a file from the list above ...", MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);
else
File.Open(file, "", SW_SHOWNORMAL);
end
The dialog message works Ok, when no file selected.
But, I always get the file that is first on the list (position 1), no matter which file is selected in the list box.
I've tried various tweaks, like setting selected="" at the begining and reseting the list at the end, but it makes no difference.
I assume by now that I'm missing something blindingly obvious.
Anyone help ?
Cheers:(
I am using a suggested script (modified) from the help files "how do I?"
I have a ListBox with a button underneath, with the following code 'on press'
selected = ListBox.GetSelectedCount("ListBox1");
file = ListBox.GetItemData("ListBox1", selected);
if file == "" then
Dialog.Message("Notice", "You must select a file from the list above ...", MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);
else
File.Open(file, "", SW_SHOWNORMAL);
end
The dialog message works Ok, when no file selected.
But, I always get the file that is first on the list (position 1), no matter which file is selected in the list box.
I've tried various tweaks, like setting selected="" at the begining and reseting the list at the end, but it makes no difference.
I assume by now that I'm missing something blindingly obvious.
Anyone help ?
Cheers:(