Blader I post too much
Reputation: 2
Joined: 19 Jan 2007 Posts: 2049
|
Posted: Mon Nov 26, 2007 7:00 pm Post subject: VB6 help (Arrays I think) |
|
|
Ok, so I have a combo box (combo1) and a button (cmdUpdate) and an invisible text box (txtList)
What I want if for the combo box to update what it has in the textbox
What I have done is loaded swf.txt file in my app path and now it's hidden in txtList.Text
I want to make it go to combo1, I tried doing the additem thing, but I haven't determined the ammount of lines the file has (user created txt file)
I've got this so far
(I already set the strings in my code in my form)
| Code: | Private Sub cmdUpdate_Click()
FileName = App.Path & "\swf.txt"
f = FreeFile
Open FileName For Input As f
txtList.Text = Input$(LOF(f), f)
Close f
'------------------------------------------
Open FileName For Input As #1
lines = Split(Input(LOF(1), 1), vbCrLf)
Close #1
Combo1.AddItem lines(0)
'----Yeah I don't know how much lines are in the file
End Sub |
Is this possible?
Also, if you have a code which can directly insert the .txt file into the combo box then post it (I think there is, but I'm too tired to search for it)
_________________
|
|