[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 263
  • Last Modified:

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.
0
she3i3i
Asked:
she3i3i
  • 3
  • 2
  • 2
1 Solution
 
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
 
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
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
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

Featured Post

Upgrade your Question Security!

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

  • 3
  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now