Unable one of the options of drop down
2 ビュー (過去 30 日間)
古いコメントを表示
Hi, please help me!
I wanna disable one of the options of drop down 2 when i chose a particular option on drop down 1. what should the codes be?
0 件のコメント
採用された回答
Mrutyunjaya Hiremath
2023 年 9 月 7 日
編集済み: Mrutyunjaya Hiremath
2023 年 9 月 7 日
You can use 'set' to change the 'Enable' property of the dropdowns in the callback functions.
Here's how you can modify the code to include lines -
% Callback function for the first dropdown
function firstDropdownCallback(~, ~)
% Disable the second dropdown
set(secondDropdown, 'Enable', 'off');
% Enable the first dropdown (in case it was disabled)
set(firstDropdown, 'Enable', 'on');
end
% Callback function for the second dropdown
function secondDropdownCallback(~, ~)
% Disable the first dropdown
set(firstDropdown, 'Enable', 'off');
% Enable the second dropdown (in case it was disabled)
set(secondDropdown, 'Enable', 'on');
end
3 件のコメント
Mario Malic
2023 年 9 月 8 日
You will have to remove the dropdown item, otherwise try with button group component.
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!