About listbox item selection: If i have two boxes how can i know from which one the cursor has selected?
조회 수: 1 (최근 30일)
이전 댓글 표시
I have two listboxes : listbox1 containing lines,and listbox2 containing cercles. And i have a button "Set" (as described in the image) to set the thikness of the selected item(line or circle). So, in the function "Set" it's written this : num =handles.selected % the value selected by the cursor is called num. e(num)=thiknss % Then we give this value a thikness. Now my problem is that i want to know from which box the "num" is selected.I need to know if it's from the box 1 ( a line) or the box2 (a circle). How can i do that?
댓글 수: 0
답변 (1개)
Image Analyst
2015년 2월 1일
That is not a good situation to use listboxes in. You are expecting to take some action based on a single selection, however you will always have two selections because you have two listboxes. You should use either radio buttons, or a popup (drop down list).
댓글 수: 7
Image Analyst
2015년 2월 1일
Final try. Try this:
selectedItemName = strcat(cell2mat(allItemNames(selectedItem)));
If that doesn't work, upload your fig file and m-file.
참고 항목
카테고리
Help Center 및 File Exchange에서 Environment and Settings에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!