Hi,
I guess the following happened: your listbox1 contains e.g. 20 file names. You select no 15. Now using your popup menu you select another type and your listbox1 contains "only" 10 file names. But you did not change the selected no 15. Therefore: your value is outside the range 1-10.
To make the long story short: it's best practice, that when you change the 'string' property of a listbox, reset the value to the first entry, i.e.
set(handles.listbox1, 'string', ListOfImageNames, 'value', 1);
Titus
Best Answer