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!