谢谢qibbxxt!问题已经解决。虽然您的解决方法和我的问题有一些出入,但是按照您的提示,我找到了解决的办法。把方法贴给大家看。
HF1=figure('color',[1 1 1],...
'name','用户控件对象示例','numbertitle','off',...
'menubar','none','visible','on');
HF2=figure('visible','off');
pushbutton1=uicontrol(HF1,'Style', 'pushbutton', 'String', 'figure 1','position',[20 150 100 70], 'Callback','set(HF1,''visible'',''on'')');
pushbutton2=uicontrol(HF1,'Style', 'pushbutton', 'String', 'figure 2','position',[120 150 100 70], 'Callback','set(HF2,''visible'',''on''),set(HF1,''visible'',''off'')');
pushbutton21=uicontrol(HF2,'Style', 'pushbutton', 'String', 'figure 1','position',[20 150 100 70], 'Callback','set(HF1,''visible'',''on''),set(HF2,''visible'',''off'')');
pushbutton22=uicontrol(HF2,'Style', 'pushbutton', 'String', 'figure 2','position',[120 150 100 70], 'Callback','set(HF2,''visible'',''on''),set(HF1,''visible'',''off'')'); |