• Welcome to Valhalla Legends Archive.
 

ChannelList Help!

Started by Distortion, July 02, 2003, 04:37 AM

Previous topic - Next topic

Distortion

I'm new to VB...  I'm using VB6 and I am making a basic chatbot for now...  I was wondering if someone could help me...  I'm trying to make a channellist...  So I could see who is active in the channel on the bot.  I'm connected on BNLS...

Grok

Since you're new, start with a ListBox.  You should see how it works before going on to other controls.

As you receive the list of names from battle.net, use the AddItem method to insert it into the ListBox.

List1.AddItem strBnetName

Deleting names, simplified, is relatively the same.  Only you first have to find the name in the ListBox, then remove it by index.

Dim lPos as Long
For lPos = 0 to List1.ListCount-1
   If strComp( List1.List(lPos), strNameToRemove ) = 0 Then
       List1.Remove lPos
       Exit For
   End If
Next lPos


After you're comfortable working with the ListBox, you'll want to try the ListView in report mode.  When you run into a brick wall there, you'll come back to the ListBox, but ownerdrawn.  Don't worry, it'll be a while before you make this round trip.