How to clear a particular field in GUI?

2 Ansichten (letzte 30 Tage)
DIJESH
DIJESH am 6 Jun. 2014
Beantwortet: DIJESH am 13 Jun. 2014
I want to clear a particular field in GUI before executing a function. I have tagged the things to be cleared. But i do not know the syntax to clear those tags.
  1 Kommentar
David Sanchez
David Sanchez am 6 Jun. 2014
What do you mean by field?
Do you want to clear an edit-box from its content and leave it blank?

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

DIJESH
DIJESH am 13 Jun. 2014
delete(findall(gcf,'Tag','Tagname'))

Weitere Antworten (2)

Ben11
Ben11 am 6 Jun. 2014
You could set the 'String' property to '' so that it displays an empty string:
set(YourHandle,'String','');
or you could make it not visible:
set(YourHandle,'Visible','Off');

Image Analyst
Image Analyst am 6 Jun. 2014
How did you "tag" them? The tag is the ID name of the control - you'll see if if you bring up the property inspector in GUIDE. Every control always must have a tag, though you can assign any name you want. What is your definition of tag? How did you "tag" the controls that you want cleared? And what exactly does "clear" mean? You can use clear() or delete() in your code to get rid of a control, though I think that's risky. Or you can use
set(handles.editBox1, 'String', '');
to remove any text in the edit text control with the tag name property of "editBox1".

Kategorien

Mehr zu Migrate GUIDE Apps finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by