editing gui text box string
Show older comments
I have a GUI project with 32 text box. Textbox tags are like this: X01, X02,...,X32. I want want to write a program that when i press a pushbutton it execute a for loop like (for i=1:32) and change the String Propery of each Textbox. same as below
for i=1:32
set(handles.ithTextbox,'String',num2str(data(i)));
end
How can I select ith Textbox?
Accepted Answer
More Answers (1)
Fangjun Jiang
on 21 Jul 2011
Would this work?
for i=1:32
Tag=sprintf('X%02d',i);
set(handles.(Tag),'String',num2str(data(i)));
end
I verified. Using dynamic field name works!
1 Comment
Milad Javan
on 21 Jul 2011
Categories
Find more on Map Display 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!