请教高手,我在用gui做编程时,有这样一个问题:在创建的一个界面上动态的添加和删除控件:例如根据弹出框中不同的内容创建不同的控件,但再次选择弹出框中的内容时,须删除上次添加的控件,此程序如何编写???下面的程序根据wname内容的不同添加edit控件或popupmenu控件,但再次选择wname中的内容是须删除上次添加的edit控件或popupmenu控件。
function wname_Callback(hObject, eventdata, handles)
% hObject handle to wname (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: contents = get(hObject,'String') returns wname contents as cell array
% contents{get(hObject,'Value')} returns selected item from wname
value=get(handles.wname,'value');
switch value
case {1,7}
case {2,3,4}
uicontrol(gcf,'style','text',...
'fontsize',10.0,'position',[950.0,600,100,20],...