Link to home
Start Free TrialLog in
Avatar of azcalv408
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!
Avatar of Hitesh Manglani
Hitesh Manglani
Flag of India image

Dim FF as Integer, str1 as Integer
FF=FreeFile
OPen Filename For Input as #FF
While Not EOF(FF)
    Line Input str1,#FF
    Combobox1.Additem(str1)
Wend
Close FF
ASKER CERTIFIED SOLUTION
Avatar of Hitesh Manglani
Hitesh Manglani
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of azcalv408
azcalv408

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

is there a way to add the list to the properties of the combobox ?
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I am sorry about the mistake in declaration of str1.