Need help in listbox

Need help in listbox

Page 1 of 1

1 Replies - 557 Views - Last Post: 05 June 2010 - 06:43 PM Rate Topic: -----

#1 Clarkhp  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 05-June 10

Need help in listbox

Posted 05 June 2010 - 12:20 PM

I need help about file handling.I want use all links in a text file for listbox.But if I use this codes

Dim a As String
Private Sub Form_Load()
Open "C:\a.txt" For Input As #1
While EOF(1) = 0
Line Input #1, a
b = b + a
Wend
Close #1
MsgBox b
List1.AddItem b
MsgBox List1.ListCount + 0
End Sub


All the links are one item in listbox.I don't know how many link I'm going to use so I don't make a lot of variables like that

Dim a As String
Dim d As String
Dim c As String
Private Sub Form_Load()
Open "C:\a.txt" For Input As #1
Line Input #1, a
Line Input #1, d
Line Input #1, c
Close #1
List1.AddItem a
List1.AddItem d
List1.AddItem c
MsgBox List1.ListCount + 0
End Sub


I need help.What should I do?

Is This A Good Question/Topic? 0
  • +

Replies To: Need help in listbox

#2 thava  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 180
  • View blog
  • Posts: 1,606
  • Joined: 17-April 07

Re: Need help in listbox

Posted 05 June 2010 - 06:43 PM

Dim a As String
Private Sub Form_Load()
Open "C:\a.txt" For Input As #1
While EOF(1) = 0
Line Input #1, a
List1.AddItem a
Wend
Close #1
MsgBox List1.ListCount + 0
End Sub


just a small logic that's all you did this
Was This Post Helpful? 1
  • +
  • -

Page 1 of 1