• Welcome to Valhalla Legends Archive.
 

Channel List Problems

Started by dodge, June 19, 2004, 10:57 PM

Previous topic - Next topic

dodge

I'm working on a simple channel list displaying the OPs first, then the rest. I've read the other posts and they've helped me out. I'm using a list, and I'm having a small irratating problem. When a user joins, I add them to the list no problem, but when I join a new channel, I clear it and add the OPs then the other people but the first one is always blank. This is what I have for when a user is in the channel:

   If Flags = "2" Then
       lstChannel.AddItem UserName, 1
   Else
       lstChannel.AddItem UserName
   End If


If I set

   If Flags = "2" Then
       lstChannel.AddItem UserName, 0


After the OPs there is a space. I tried an if statement to increment the number after UserName but it didn't work, maybe I did it wrong not sure.

Note: Using CSB (I know, I'm sorry  :'() and programming in VB. Thanks :)


EDIT:
My problem with the IF statement was setting the counter to go from 1 to the number of people in the channel...

       For i = 1 To (whathere) Step 1
           lstChannel.AddItem UserName, i
       Next


BinaryzL

Wow I think there is a post about this like 7 subjects done and probably on the forum a million times!

http://forum.valhallalegends.com/phpbbs/index.php?board=17;action=display;threadid=7313

dodge

Like I said, I've read these posts. My problem is there is a blank before the OPs or after the OPs, I have the OPs thing completed but there is a blank space, or box in the list. That's what I'm trying to get rid of.

LordNevar

I use to have the same problem, It's your on flags event. It's not setting the icons properly when someone joins the channel. You have to go back and redo all your Flag call's, and your Flag event. Just set it to manually add the Icon, instead of trying to do it automatically.

A good fortune may forbode a bad luck, which may in turn disguise a good fortune.
The greatest trick the Devil ever pulled, was convincing the world he didn't exsist.

TeEhEiMaN

you cant add images to a list box, you need to use a list view.


if flags = "2" Then
form1.lvChannel.ListItems.Add , , username, , 1

Elesif client = "PXES" then
form1.lvChannel.ListItems.Add , , username, , 2


and so on

StepAside

QuoteCode:

       For i = 1 To (whathere) Step 1
           lstChannel.AddItem UserName, i
       Next


Odd sort of "If" statement with a "For" loop eh?
Anyway, I'd recommend a ListView if you are unfamiliar with ListBox indexes.

dodge

thanks for the help guys.. I used a listview and solved the problem lol. Next onto icons ;)

TeEhEiMaN

lol, yes!!!! this was probably the first thing that i helped some buddy with. Im gettin better!