Effacer les filtres
Effacer les filtres

Unable one of the options of drop down

4 vues (au cours des 30 derniers jours)
Amron
Amron le 7 Sep 2023
Modifié(e) : Amron le 10 Sep 2023
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?

Réponse acceptée

Mrutyunjaya Hiremath
Mrutyunjaya Hiremath le 7 Sep 2023
Modifié(e) : Mrutyunjaya Hiremath le 7 Sep 2023
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 commentaires
Mario Malic
Mario Malic le 8 Sep 2023
You will have to remove the dropdown item, otherwise try with button group component.
Amron
Amron le 10 Sep 2023
Modifié(e) : Amron le 10 Sep 2023
So, i can't disable one of the options of my dropdown without delete it? Okay thanks bro, i'll try the button group

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur App Building dans Help Center et File Exchange

Produits


Version

R2022a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by