Perm. add items to ComboBox.

Can this be done:

   I have a ComboBox in the IDE into which I've entered 5 items. Is there a way to add a new item to that ComboBox during run time so that its available as one of the pre-defined items the next time I start my application?

Cheers, Chris.
LVL 1
she3i3iAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

jeurkCommented:
Save the items list in the registry and
restore it next startup.
the rxlib www.rxlib.com (free)
has a component called formstorage
that let's you do that painless.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
wimmeyvaertCommented:
Hi there,

You can add items to a combobox at runtime by using the Add-procedure
(ComboBox1.Items.Add('another line');)

You can use the procedures 'LoadFromFile' and 'SaveToFile' to load and save all the items of the combobox to a textfile.

Example :
ComboBox1.Items.LoadFromFile('c:\test.txt');
ComboBox1.Items.SaveToFile('c:\test.txt');

Hope this will solve your problem
0
jeurkCommented:
Hello,
I have to admit that it's an elegant
solution that I did not thought of.

CU
0
Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

she3i3iAuthor Commented:
:)

   I couldn't agree more cause I finally used wimmeyvaert's method as it would keep the info even after say a format!

   Both answers are valid and work... so I'm going to issue 25 points to wimmeyvaert too!

Cheers, Chris.
0
jeurkCommented:
Right,
we definitely need a way to share the
points between more then one expert.
CU
0
wimmeyvaertCommented:
Hi she3i3i & jeurk,


Thanx for splitting the points.
Not that I need the points that hard,
but it's always nice if your comment
is being appreciated.



Best regards,
The Mayor


0
she3i3iAuthor Commented:
Hi,

.... I didn't split the points... I'm giving full points to both of you... but in order for me to you points, you need to post a comment on the post i made for you...

Thanks, Chris.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Delphi

From novice to tech pro — start learning today.