[Help]adding items to the listview code
guys. I need some help here.
if I want to add something to the listbox by this code
Code:
Public Sub Add_Item( _
ByVal Moderator As String, _
ByVal User As String, _
ByVal Type As String, _
ByVal Points As String, _
ByVal Reason As String)
Dim Count As Integer = 0
ListView1.Items.Add(Moderator)
ListView1.Items(Count).SubItems.Add(User)
ListView1.Items(Count).SubItems.Add(Type)
ListView1.Items(Count).SubItems.Add(Points)
ListView1.Items(Count).SubItems.Add(Reason)
Count += 1
End Sub
it just appears as 1 and it can't add other items no longer..
could someone solve this problem... thanks.
Where's the count function for ?
Why you dont just use
listview.items.add("") ?
[php] Dim Count As Int = 0
ListView1.Items.Add(Moderator)
Count = ListView1.Items.Count-1
ListView1.Items(Count).SubItems.Add(User)
ListView1.Items(Count).SubItems.Add(Type)
ListView1.Items(Count).SubItems.Add(Points)
ListView1.Items(Count).SubItems.Add(Reason) [/php]
Else, the first count will be -1.
Just create the item variable, add subitems to it.. and then add that item to the list... :\ no need for all that stuff
Oops thanks for that little error fix Kevin, turns out I had the the fail logic.
thanks for the codes guys. I just tried to create my program for managing a forum because I'm also a moderator of it. so I want to record my status on it ^^
*Solved