setting radiobutton value by program
6 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Diego
le 28 Jan 2015
Déplacé(e) : Image Analyst
le 22 Mai 2024
I have a panel with several radiobuttons so that only one of them is selected at the time, it works fine with my mouse. However, I want to create a pushbutton that when I push it will select a specific radiobutton on the panel
So for example I have radiobuttons A B and C and I clicked on C at one time then with the pushbutton I want to set A again as if I have clicked A with my mouse.. how can I do that??
Thank you in advance...
0 commentaires
Réponse acceptée
Image Analyst
le 28 Jan 2015
Yes. Do it this way:
set(handles.radioA, 'Value', 1);
If the other B & C radio buttons are in a group panel, then the B & C radio buttons will automatically be set to false once this line executes . Otherwise you can set them to false manually with the set() function also.
1 commentaire
Image Analyst
le 28 Jan 2015
Modifié(e) : Image Analyst
le 28 Jan 2015
Diego's "Answer" moved here since it's not an answer to the original question:
thank you very much
Plus de réponses (1)
Josiah Brough
le 20 Mai 2024
Déplacé(e) : Image Analyst
le 22 Mai 2024
Also works with:
app.ButtonGroup.SelectedObject = app.ButtonA;
0 commentaires
Voir également
Catégories
En savoir plus sur Interactive Control and Callbacks dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!