error using list box, please help!!!
Show older comments
my gui has a listbox1.
the list box has 2 (values).
for each values i have two different numbers, and i want to change the string and the handle of a edit text (edit1).
when i run the gui and click for the first time on the listbox every thing is OK.....but when i click for the second time appears the following error :
??? Error using ==> set
Invalid handle object.
Error in ==> GUI>listbox1_Callback at 110
set(handles.edit1,'String',X)
Error in ==> gui_mainfcn at 96
feval(varargin{:});
Error in ==> GUI at 42
gui_mainfcn(gui_State, varargin{:});
Error in ==>
@(hObject,eventdata)GUI('listbox1_Callback',hObject,eventdata,guidata(hObject))
??? Error while evaluating uicontrol Callback
________________________
here is my code:::
function listbox1_Callback(hObject, eventdata, handles)
Z=get(hObject,'value')
if Z==1
X=120;
elseif Z==2
X=240;
end
set(handles.edit1,'String',X)
handles.edit1=X
guidata(hObject,handles)
___________
thank for helping my solving this issue.
Accepted Answer
More Answers (0)
Categories
Find more on Desktop in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!