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

4 次查看(过去 30 天)
I have a radio button group woth 2 buttons; depending on which radiobutton is selected, I want to enable/disable a pushbutton.
  1 个评论
VBBV
VBBV 2020-11-27
编辑:VBBV 2020-11-27
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

请先登录,再进行评论。

回答(1 个)

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

类别

Help CenterFile Exchange 中查找有关 Migrate GUIDE Apps 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by