Valhalla Legends Archive

Programming => Battle.net Bot Development => Topic started by: CrAz3D on May 30, 2003, 11:07 PM

Title: ListView Stuff
Post by: CrAz3D on May 30, 2003, 11:07 PM
for some reason I am not able to add a subitem to my main item, how do I add more columns or whatever I need to do?
Title: Re:ListView Stuff
Post by: ______ on May 31, 2003, 07:13 AM
properties, then columns then insert.. make the columns any width you like them to be.
Title: Re:ListView Stuff
Post by: Grok on May 31, 2003, 09:19 AM
This will make a listview with columns Name, Color, Speed.

Private Sub Form_Load()
   lvw.ColumnHeaders.Add "","c1","Name"
   lvw.ColumnHeaders.Add "","c2","Color"
   lvw.ColumnHeaders.Add "","c3","Speed"
End Sub

Private Sub AddLVWItem(ItemName As String, Color As String, Speed As String)
   Dim obj As ListItem
   Set obj = lvw.ListItems.Add( , ItemName, ItemName)
   obj.SubItems(1).Text = Color
   obj.SubItems(2).Text = Speed
End Sub


I've written this from memory only, not having VB6 on my PC at the moment.

Hope this helps.
Title: Re:ListView Stuff
Post by: CrAz3D on May 31, 2003, 03:30 PM
Ok, I got all of that but now I'm not able to find the last # on the listview.  This is my code but for some reason it gives me the error:Index out of Bounds.

Code:SpamCount = frmLists.Spam.FindItem(strUser).ListSubItems(2).text

That IS the correct index, but for some reason it's all whacked out.
Title: Re:ListView Stuff
Post by: Noodlez on May 31, 2003, 03:52 PM
i'm pretty sure you do .ListSubItems.Add ,,"text"  not just .SubItems(index).Text
Title: Re:ListView Stuff
Post by: CrAz3D on May 31, 2003, 04:05 PM
I don't want to add to that second index, I want to find out what that index is.