GUIDE-edit text

4 visualizzazioni (ultimi 30 giorni)
john
john il 22 Feb 2012
Modificato: Image Analyst il 20 Ott 2013
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');

Risposta accettata

Sean de Wolski
Sean de Wolski il 22 Feb 2012
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 Commenti
john
john il 1 Mar 2012
I doesn't have 'selected' in property inspector ....
Sean de Wolski
Sean de Wolski il 1 Mar 2012
web([docroot '/techdoc/ref/uicontrol_props.html'])

Accedi per commentare.

Più risposte (1)

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

Categorie

Scopri di più su Desktop in Help Center e File Exchange

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by