VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Add Item to listview

by Ridium (3 Submissions)
Category: String Manipulation
Compatability: Visual Basic 3.0
Difficulty: Beginner
Date Added: Wed 3rd February 2021
Rating: (10 Votes)

takes a string like "Johnny*(722)555-5555*35" and splits it into columns on a listview control(designed for Report view)

Inputs
lst = Listview control zString = data string with *'s between the words

Rate Add Item to listview

Sub ReportAddTo(lst As ListView, zString As String)
Dim bleh As ListItem
'zString = "One*Two*Three*Four*Five"
On Error Resume Next

Set bleh = lst.ListItems.Add(, , Split(zString, "*")(0))
    
For i = 1 To 200
  bleh.SubItems(i) = Split(zString, "*")(i)
Next i

End Sub

Download this snippet    Add to My Saved Code

Add Item to listview Comments

No comments have been posted about Add Item to listview. Why not be the first to post a comment about Add Item to listview.

Post your comment

Subject:
Message:
0/1000 characters