Hi
How can I add new strings into a listbox?
By using \n doesn't seem to do the job.
I tried:
initial_name=get(handles.listbox,'String')
new_name = sprintf('%s\n%s',initial_name,new_line) % assume there is a string store in variable new_line
set(handles.listbox,'String',new_name) gives the new_line and initial_line on the same line.
Thanks
Zheng
|
|
0
|
|
|
|
Reply
|
zheng
|
3/26/2011 1:21:04 AM |
|
On 25/03/11 8:21 PM, zheng chew wrote:
> How can I add new strings into a listbox?
> By using \n doesn't seem to do the job.
> I tried:
>
> initial_name=get(handles.listbox,'String')
> new_name = sprintf('%s\n%s',initial_name,new_line) % assume there is a
> string store in variable new_line
> set(handles.listbox,'String',new_name) gives the new_line and
> initial_line on the same line.
initial_name=cellstr(get(handles.listbox,'String'));
new_name = [initial_name;{new_line}];
set(handles.listbox,'String',new_name)
|
|
-1
|
|
|
|
Reply
|
Think
|
3/26/2011 3:58:11 AM
|
|
"Think blue, count two." <roberson@hushmail.com> wrote in message <nvdjp.1160$4S1.799@newsfe21.iad>...
> On 25/03/11 8:21 PM, zheng chew wrote:
>
> > How can I add new strings into a listbox?
> > By using \n doesn't seem to do the job.
> > I tried:
> >
> > initial_name=get(handles.listbox,'String')
> > new_name = sprintf('%s\n%s',initial_name,new_line) % assume there is a
> > string store in variable new_line
> > set(handles.listbox,'String',new_name) gives the new_line and
> > initial_line on the same line.
>
> initial_name=cellstr(get(handles.listbox,'String'));
> new_name = [initial_name;{new_line}];
> set(handles.listbox,'String',new_name)
Hi,
Just create a cell and set by handles.
for i=1:length(list)
handles.names(i)=list(i) % fill handles struct with values that you want like to input in
end
set(handles.Listbox1,'String',handles.names)
|
|
-1
|
|
|
|
Reply
|
punktrading
|
11/17/2011 9:20:29 PM
|
|
|
2 Replies
2095 Views
(page loaded in 0.174 seconds)
Similiar Articles: adding hyperlinks in listbox as its items - comp.soft-sys.matlab ...NetBeans jList Add/Clear Items - comp.lang.java.gui I am attempting to clear a jList in NetBeans and add new items. However, I get ... add new string to listbox - comp ... How to initialize a listbox? - comp.soft-sys.matlabadd new string to listbox - comp.soft-sys.matlab How to initialize a listbox? - comp.soft-sys.matlab add new string to listbox - comp.soft-sys.matlab How to initialize a ... How to add new LUN's - comp.unix.solarisadd new string to listbox - comp.soft-sys.matlab How to add new LUN's - comp.unix.solaris How to add string (after substr) - comp.lang.awk add new string to listbox - comp ... Help with JList and JComboBox - comp.lang.java.gui... new BorderLayout() ); getContentPane().add( topPanel ); // Create some items to add to the list String listData[] = { "One", "Two", "Three", "Four" }; listbox = new ... getContentPane().add - comp.lang.java.guiadd new string to listbox - comp.soft-sys.matlab Hi How can I add new strings into a listbox? By using \n doesn't seem ... with JList and JComboBox - comp.lang.java.gui ... NetBeans jList Add/Clear Items - comp.lang.java.guiNetBeans jList Add/Clear Items - comp.lang.java.gui I am attempting to clear a jList in NetBeans and add new items. However, I get ... add new string to listbox - comp ... Add textbox on a figure - comp.soft-sys.matlabadding hyperlinks in listbox as its items - comp.soft-sys.matlab ... add new string to listbox - comp.soft-sys.matlab adding ... Justin: did you ever figure out how to ... Listbox GUI - comp.soft-sys.matlab... and use that character array or cell array as the value of the String property of the listbox . ... I am very new to GUIDE... sorry that i seem like dunno how the thing ... Initializing IMPLAY from Matlab Code - comp.soft-sys.matlab ...How to initialize a listbox? - comp.soft-sys.matlab add new string to listbox - comp.soft-sys.matlab How to initialize a listbox? - comp.soft-sys ... create a new window, WNDCLASS or resource.rc? - comp.os.ms-windows ...Handle Graphics failed in matlabrc - comp.soft-sys ..... or resource.rc? - comp.os.ms-windows ... How to initialize a listbox? - comp.soft-sys.matlab add new string to ... add new string to listbox - Newsreader - MATLAB CentralFile exchange, MATLAB Answers, newsgroup access, Links, and Blogs for the MATLAB & Simulink user community C# adding Strings to a list box. ? - Yahoo! AnswersNew User? Register; Sign In; Help ... What I am trying to do is simply add Strings to a list ... listBox.Add(strArray[i]);} I haven't worked in C# for a ... 7/20/2012 7:55:41 AM
|