Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21096

Listbox, Columns Question

$
0
0
I'm workin on this program that takes the string from the listindex (if the listindex has multiple words), and seperates all the words into its own index. For example

"Welcome to vb"
"forums enjoy."

and i'm trying to get it to change it all to 1 column.

"Welcome"
"to"
"vb"
"forums"
"enjoy"

Code:

Dim x As Long, str As String
x = 0

Do While x < lstAccount.ListCount
    If InStr(lstAccount.List(x), " ") Then
        str = lstAccount.List(x)
        str = Split(str, " ")(0)
        lstAccount.AddItem str
    End If
x = x + 1
Loop

this works. but it only works on the first word. i need it to go through the whole string
this code makes the example come out
"Welcome"
"forums"

Viewing all articles
Browse latest Browse all 21096

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>