GUIDE-edit text

조회 수: 18 (최근 30일)
john
john 2012년 2월 22일
편집: Image Analyst 2013년 10월 20일
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에서 Desktop에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by