Thread Subject: Help populating a listbox

Subject: Help populating a listbox

From: Darran Specter

Date: 7 Sep, 2006 12:00:49

Message: 1 of 2

I would like a piece of code that can take a number of strings, which
will not be determined until runtime, and use them to populate a list
box:
eg
String1
String2
.
.
.
StringN

I don't know N unitl runtime.

Thanks allot

Subject: Help populating a listbox

From: Dan K

Date: 8 Sep, 2006 09:40:44

Message: 2 of 2

Actually it is deceptively simple:

Put your strings into a cell array strings and set:

set(listboxHandle,'String',strings);
That's it.

HTH

Darran Specter wrote:
> I would like a piece of code that can take a number of strings, which
> will not be determined until runtime, and use them to populate a list
> box:
> eg
> String1
> String2
> .
> .
> .
> StringN
>
> I don't know N unitl runtime.
>
> Thanks allot

Tags for this Thread

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

rssFeed for this Thread

Contact us at files@mathworks.com