Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

thomashun

VB help with reading from file to combobox

This topic is 6358 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

ok I got a .txt that goes something like this 3 "Name" "other name" "street" 2 1 Well anyway how do you read the "Name" into the combobox because i keep getting all the info to read in instead of just the name.

Share this post


Link to post
Share on other sites
Advertisement
Use a TextStream to read in one line at a time:
In your project, set a reference to Microsoft Scripting Runtime

dim fso as new FileSystemObject
dim ts as TextStream

set ts = fso.OpenTextFile("name", I/O mode etc...)

Do While ts.AtEndOfStream = False
Combo1.AddItem (ts.ReadLine)
Loop

ts.Close


Edited by - noparity on July 23, 2001 12:16:06 PM

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!