how to enable/disable a pushbutton based on a radio selection? (guide gui)

7 Ansichten (letzte 30 Tage)
A
A am 20 Dez. 2012
Bearbeitet: VBBV am 27 Nov. 2020
I have a radio button group woth 2 buttons; depending on which radiobutton is selected, I want to enable/disable a pushbutton.
  1 Kommentar
VBBV
VBBV am 27 Nov. 2020
Bearbeitet: VBBV am 27 Nov. 2020
if get(handles.radiobutton1,'Value') == 1
set(handles.pushbutton1,'enable','off');
... % rest of code
elseif get(handles.radiobutton2,'Value') == 1
set(handles.pushbutton2,'enable','off');
... % rest of code
end

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Sean de Wolski
Sean de Wolski am 20 Dez. 2012
In the radio button or uibuttongroup callback:
set(handles.pushbutton1,'enable','off');

Kategorien

Mehr zu Modeling finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by