azcalv408
asked on
vb6 load text file into combobox
hi,
I have a list of items from a text file...Is there a way to load them into a combobox control on a form ? Thanks!
I have a list of items from a text file...Is there a way to load them into a combobox control on a form ? Thanks!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
what's FreeFile
You have to assign a file number to a file when you open it as a reference to the other commands acting on the file. It finds a free (unused) number.
FreeFile Function - http://msdn2.microsoft.com/en-us/library/aa445002(VS.60).aspx
FreeFile Function - http://msdn2.microsoft.com/en-us/library/aa445002(VS.60).aspx
ASKER
is there a way to add the list to the properties of the combobox ?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I am sorry about the mistake in declaration of str1.
FF=FreeFile
OPen Filename For Input as #FF
While Not EOF(FF)
Line Input str1,#FF
Combobox1.Additem(str1)
Wend
Close FF