473,385 Members | 1,901 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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

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
box.

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.

Thankyou

Nov 7 '06 #1
0 1890

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Drew | last post by:
I have a db table like the following, UID, int auto-increment RegNo Person Relation YearsKnown Now here is some sample data from this table,
2
by: Sean | last post by:
Hi, I am facing a problem, and i don't know why the error is being generated. I am updating a datagrid with an XML file. My code is Protected Sub UpdateCommand(ByVal Sender As Object,...
3
by: ssb | last post by:
Hello, This may be very elementary, but, need help because I am new to access programming. (1) Say, I have a column EMPLOYEE_NAME. How do I fetch (maybe, cursor ?) the values one by one and...
7
by: Ohad Asor | last post by:
Hello all, I have an ASP.NET page I've written using VS.NET2003, which have a ListBox in it. When I press a button in the form, I try to get the selected item in the list by calling...
3
by: sck10 | last post by:
Hello, I am creating a form for users to enter information about a lab and the members of the lab. I have one form (FormView) that they use to enter information about that lab. The keyvalue is...
3
by: keithb | last post by:
My code dynamically adds template fields to a GridView control. Everything seems to work OK, except when updating, because I haven't found a way to reference the dynamically added textboxes....
5
by: CCLeasing | last post by:
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...
0
by: Bomac8 | last post by:
I have a text file with "|" as a delimeter with three (3) fields XXX-12345|\\YYYYYYY|\\ZZZZZZZZ I need to read these files into an output folder. The problem that I'm having is that I need to...
9
by: Phill W. | last post by:
VB.Net 2005 SP1 Windows Forms Application What's the fastest way to append text to a TextBox? I have an application that monitors data written to text files. It needs to scan some fairly...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.