GUIDE-edit text

1 次查看(过去 30 天)
john
john 2012-2-22
Hi,
I have edit text in guide. When I write anything to edit, then I want enable pushbutton. So, how can I do this?
. . . set(handles.pushbutton, 'enable','on');

采纳的回答

Sean de Wolski
Sean de Wolski 2012-2-22
function exampleEditEnable
%Build stuff
hFig = figure;
hBut = uicontrol('style','push','units','norm','position',[0 0 0.3 0.1],'enable','off','string','can''t touch this'); %a button
hEdit = uicontrol('style','edit','units','norm','position',[0.5 0.5 0.3 0.1],'string','edit me, I dare you!','callback',@enableButton); %an edit box
function enableButton(varargin)
set(hBut,'enable','on');
set(hBut,'string','can touch this');
end
end
To translate this into GUIDE just use handles.edit and handles.pushbutton etc.
  7 个评论
john
john 2012-3-1
I doesn't have 'selected' in property inspector ....
Sean de Wolski
Sean de Wolski 2012-3-1
web([docroot '/techdoc/ref/uicontrol_props.html'])

请先登录,再进行评论。

更多回答(1 个)

Kevin Holst
Kevin Holst 2012-2-22
you would put that code that you wrote in the edittext callback function.

类别

Help CenterFile Exchange 中查找有关 Text Data Preparation 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by