By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,241 Members | 733 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,241 IT Pros & Developers. It's quick & easy.

help - populating a combox box from a text file and updating a textbox automatically

P: n/a
Hello, I have searched google but can not find a straight forward
answer to my problem. Hopefuly someone will be kind enough to offer
their expertise. Please forgive if this seems a bit convoluted but this
is probabally a reflection of my not clear understanding of the
mechanics behind what i'm trying to achieve. Please bear with it I
really could do with your help.

I have a simple windows form. There are two controls on the form that I
am struggling with. One is a combo box and one is a mutli line text

What I would like to.
I would like to populate the combo box control from a text file.
The data that I would like to populate the combo box with is
hierarchical. It consists of units and subinits of data. I would like
to store the data in a text file in the following kind of format: -

1 Gold ; 1.2 Golden Blue ; 1.3 Golden Green
2 Red
3 Purple ; 3.1 Purple Grey ; 3.2 Purple yellow

When the combo box is clicked i would like the drop down box to display
something like this .

1. Gold
1.2 Golden Blue
1.3 Golden Green
2. Red
3. Purple
3.1 Purple Grey
3.2 Purple Yellow

When a selection is made in the combo box I would like the textbox on
the form to update itself with the data that matches the selection in
the combobox. Many options from the combo box would share the same
associated data for the textbox control. So my thought was that maybe I
could add another bit of data to my text file to indicate what textbox
data is linked with the combobox item, maybe like this: -

1 (a) Gold ; 1.2 (a) Golden Blue ; 1.3 (a) Gold Green
2 (a) Red
3 (c) Purple ; (b) 3.1 Purple Grey ; (e) 3.2 Purple yellow

So basically what I want to do is: -

a. know how to populate the combo box with data from a text file in
roughly the format i've proposed.
b. know how to check for the bracketed character associated with the
combo box selection when a selection is made.
c. populate the textbox control with data from another text file when a
selection on the combo box is made. Depending on the bracketed value
picked up from step c. The text file for the textbox control would look
something like this : -

a. some text here
b. some text here
c. some text here

I really appreciate your help, if you might be able to offer advice
please do.


Nov 7 '06 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.