visibility of an edit text / GUI

12 次查看(过去 30 天)
I have a push button and a edit text in my GUI and I want this edit box to be visible only if the push button is pressed. I want to know how should I do that.

采纳的回答

Tom
Tom 2013-6-28
First of all, I think you should use a togglebutton, as with a pushbutton the edit box would go invisible as soon as you let go of the mouse button.
for the button callback:
if get(hObject,'Value')
set(handles.editTag,'Visible','On')
else
set(handles.editTag,'Visible','Off')
end
Where editTag is the Tag of your edit button (The default is edit1)

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Interactive Control and Callbacks 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by