get edit box value
3 views (last 30 days)
Show older comments
I have created a GUI script in which the user will determine the number of edit text boxes. The user will fill these text-boxes. All the text boxes are assigned to a single callback function from which i want to read the string of these text-boxes.
f.e:
function Calback_Name(hObject, eventdata, handles)
String_Nr_1=(get(handles.tag-of-texbox-1, 'String'))
String_Nr_2=(get(handles.tag-of-texbox-2, 'String'))
However it seems that the get(handle.tag,'String') doesn not work when the text-boxes are created programmatically and not straight from GUIDE. Any idea?
2 Comments
Jan
on 20 Dec 2015
Please do not only claim, that "it doesn't work", butexplain, why you think so. Do not post pseudo code, because the problem concerns the real code. Or did you really try to call the fields "tag-of-texbox-1"?
Answers (1)
Jan
on 20 Dec 2015
Has the handles struct been modified after the callbacks are created? Then:
function Calback_Name(hObject, eventdata)
handles = guidata(hObject);
String_Nr_1 = get(handles.texbox1, 'String');
String_Nr_2 = get(handles.texbox2, 'String');
0 Comments
See Also
Categories
Find more on Migrate GUIDE Apps in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!