-
Aug 22nd, 2014, 12:55 PM
#1
Thread Starter
Lively Member
Populating comboboxes and textboxes using contents of a CSV file
Hello all.
Thank you for looking, and thank you in advance for your assistance!!! FYI - using Visual Basic in Visual Studio 2010
I have an application that is basically a series of fields.... the left column is 24 combo-boxes that have time slots within each dropdown (8am, 8:15am, 8:30am, etc.). The center column is 24 text boxes which contain file names (indicating which data file is to be used at which time). Nothing special about this - just a way for us to visualize the information we need.
Once populated I can save the current state of all of the fields as a CSV file. the format is similar to: combobox1,textbox1,combobox2,textbox2, etc.
Now what I need to do is re-populate the application fields from a previously saved CSV file. I already have code that opens the file and parses each individual element out of the long list..... but now I am stumped as to what to do with each of these elements.
I need the first element to re-populate combobox1, the second element to re-populate textbox1, the third to re-populate combobox2, etc.
Despite days of searching on Google, I cannot figure out any way to make this happen. I have even attempted to explore using tab/focus order in an attempt to possibly exploit it. No luck.
I know if VB6 you could attach a variable to a control name, for example: textbox[i], or something to that manner, to help identify the control numbers by variable.... but I gather this feature is not in 2010.
Can someone PLEASE help give me some direction here????
I would appreciate any input!
-Dave
-
Aug 22nd, 2014, 02:33 PM
#2
Re: Populating comboboxes and textboxes using contents of a CSV file
There are numerous posts around about making an array of form objects, similar to a control array, just search "control array" in the vb.net forum.
My personal suggestion would be to get rid of all your combo boxes and use a datagridview instead.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|