Interaction between two list box problem
Show older comments
I have two list boxes, one with some data and the other empty. I have two buttons, one to add data from one to the other and the other does the same but in the opposite direction. When the data gets moved across it gets removed from the original list box.
numm=get(handles.listbox1,'Value')
list1=get(handles.listbox1,'String');
list2=get(handles.listbox2,'String');
set(handles.listbox2,'String',[list2;list1(numm)]);
list1(numm,:) = []
set(handles.listbox1,'String',list1);
For example if my listbox had 4 lines of data in it, I can select any of the first three and move it over, but if I select the 4th bit of data first and move it across I get the error
"Warning: single-selection listbox control requires that Value be an integer within String range Control will not be rendered until all of its parameter values are valid "
I'm not sure why this is happening.
Accepted Answer
More Answers (0)
Categories
Find more on App Building in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!