11-555-66654-11.. how to load in a listbox :(

FarisNT
10-11-2005, 03:05 AM
Hello...
I have a Question in VB6
If I have these numbers 122-55-333-544-21111-1124

How can I add them each number to a listbox1
I mean to be 122
55
333
ect
Thank you

vbtricks
10-11-2005, 03:08 AM
Hello,

you need to split the string to an array and then add the entries of the array to the listbox:

Dim sSplitted() As String
Dim i As Integer
sSplitted = Split("122-55-333-544-21111-1124", "-")
For i = 0 To Ubound(sSplitted)
List1.AddItem(sSplitted(i))
Next i

That's all.


Stefan

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum