Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Populate ComboBox from a .ini file

Status
Not open for further replies.

smcc12

Programmer
Jan 8, 2009
17
US
Hello, I am trying to create a VB.NET application and I am new at it.

I've got a combo box that will drop down and display about 30 options. There is one button and when the user clicks it, it will shoot off the .exe for the option they selected. I am wondering if it is possible to populate the combo box with items from an .ini file (or another file that works). This way we can change what the options are without changing the actual application.

Thanks in advance!
 
I've read a lot on this forum about XML files being a better way to go, any ideas on how to accomplish the same thing through that?
 
I would use XML over an ini file. XML works fairly well with DataSets in .Net. You can create a DataSet and use the .ReadXML and .WriteXML methods of the DataSet to write out your XML file and read the data back in when your application launches. You can then bind your ComboBox to the DataSet.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top