Programmatically select value in a list box
조회 수: 24 (최근 30일)
이전 댓글 표시
I want to rearrange elements in a list box of a block mask in a
function moveDown(maskObj, controlName)
The rearrangement basically works as desired, however I am struggling with updating the selection after rearrangement.
When using
controlHandle = maskObj.getDialogControl(controlName);
selectedItems = controlHandle.getSelectedItems;
then rearranging the entries with
controlHandle.TypeOptions = rearrangedItems;
setting the same set of selected entries as before with
controlHandle.setSelectedItems = selectedItems;
fails with
% Error: Assignment not supported becuase the result of method
% 'setSelectedItems' is a temporary value
How can I update the selected items in the list box properly?
Thanks for your support.
댓글 수: 0
채택된 답변
Fangjun Jiang
2025년 12월 19일 13:59
편집: Fangjun Jiang
2025년 12월 19일 13:59
should be
controlHandle.setSelectedItems(selectedItems)
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Create Block Masks에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!