Effacer les filtres
Effacer les filtres

How to disable the checkbox "don't show this dialog again"

4 vues (au cours des 30 derniers jours)
Renaud
Renaud le 1 Août 2024
Modifié(e) : Aditya le 1 Août 2024
Hello everyone,
I'm trying to make a dialog box with multiple responses. I want this dialog box to always appear, thus I'd like to disable the "Do not show this dialog again".
Here is an exemple of my code (I use MATLAB 2018b) :
temp.group = "grouptest"; temp.pref = "preftest"; temp.title = "Are you hungry ?";
temp.quest = ["Do you want a sandwich ?"];
temp.pbtns = ["yes","no"]; temp.pval = uigetpref(temp.group,temp.pref,temp.title,temp.quest,temp.pbtns, ...
"CheckboxState",0, "ExtraOptions","Cancel");
if strcmp(temp.pval,'yes') == 1
exemple = 1
elseif strcmp(temp.pval,'no') == 1
exemple = 2
else
clearvars temp
end

Réponse acceptée

Aditya
Aditya le 1 Août 2024
Modifié(e) : Aditya le 1 Août 2024
You can either reenable the button everytime or you can create your own custom dialog box using "questdlg" function:
To reenable it you can use "setpref" or "uisetpref" function as mentioned in this link:
To create a custom question dialog box you can refer to this MathWorks documentation link:
I hope this helps!

Plus de réponses (0)

Catégories

En savoir plus sur Dialog Boxes dans Help Center et File Exchange

Produits


Version

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by