• Welcome to Valhalla Legends Archive.
 

My channellist is messed up!

Started by Yegg, September 14, 2004, 04:17 PM

Previous topic - Next topic

Yegg

I have a problem with my channel list for my CSB bot, my channel list (its listview) shows all the usernames, but, it shows them so that they are all scrambled. The names r over-lining eachother and going in all kidns of weird directions, longer names take up 3 lines. I think this only happens because i made my bot not to recognize icons. Any one know wut to do to help me? (i can show u the needed code if u need it to help me)

Networks

#1
Make your channellist longer or wider and maybe show us some code?

Maybe your column header is to small?

MyndFyre

Have you successfully added items to your list in design-time mode?  If not, there's a problem with your properties in design that have nothing to do with any code whatsoever.

I would look into that first.
QuoteEvery generation of humans believed it had all the answers it needed, except for a few mysteries they assumed would be solved at any moment. And they all believed their ancestors were simplistic and deluded. What are the odds that you are the first generation of humans who will understand reality?

After 3 years, it's on the horizon.  The new JinxBot, and BN#, the managed Battle.net Client library.

Quote from: chyea on January 16, 2009, 05:05 PM
You've just located global warming.

LordNevar

When you scroll through your channellist do the names fix?

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.

Yegg

#4
No scrolling through them does not fix the problem.
Ok, hers my code for users alread in a channel:


Private Sub CleanSlateBot1_UserInChannel(ByVal username As String, ByVal flags As Long, ByVal Message As String, ByVal Ping As Long, ByVal Product As String, StatUpdate As Boolean, SimulatedEvent As Boolean)
   strJSTR = Product
   strSexp = Product
   strSTAR = Product
   strd2 = Product
   strD2XP = Product
   strW2BN = Product
   strw3 = Product
   strDiablo = Product
Dim icon As Integer
Dim lagicoN As Integer
If icon = ICON_GAVEL Then
With Form1.lvChannel.ListItems.Add(1, username, username, , icon)
   .ListSubItems.Add lvChannel.FindItem(username).Index, , , lagicoN
   End With
End If
If icon <> ICON_GAVEL Then
   With Form1.lvChannel.ListItems.Add(, , username, , icon)
   .ListSubItems.Add , , , lagicoN
   End With
End If
Label2 = lvChannel.ListItems.Count
End Sub


Im not sure what im doing wrong but im sure its a code problem now, because now (after i tried fixing something) my channel list if blank, and if i randomly click around it, I can see a users name.
Any1 know wut i do now?  (I don't think the channellists size should matter, but i did make it pretty small, like flawed bot)

Added [ code ] tags.
- Spht

LordNevar

Try adding this

Form1.lvChannel.Refresh at the end of your code.

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.

Stealth

#6
While that is a horribly-written piece of code, I would venture a guess that the problem lies with your ListView properties. Click on it and press SHIFT+F4, and look for options that might be set incorrectly.

Edit: Didn't see MyndFyre's post. Apparently you didn't, either.
- Stealth
Author of StealthBot

Networks

#7
I am thinking the simplest way to deal with this is to delete the listview your using and create a new one by dragging and dropping it from the toolbar to the form and setting the properties yourself. I am sure this will work.

LivedKrad

Learn properties.

[Note: I want NO REPLIES FROM STEALTH TO MY RESPONSE!]

Yegg

Ok, i did what networks said to do, i just re-created my listview, which that allowed me to see the users in the channel again, only they're stil all over the place, the usernames r scrambled everywhere, and im sure that my listview's properties r correct, bcuz i copied them from my old bot. So for now if ne1 thinks something is nwrong with my code or stil something wrong with the properties, you can help, if i figure the problem out, i'll reply back.

LivedKrad

First of all, you need to set the view to Report. Something required for report however, is a column. Try right clicking on the listview and selecting Properties. Go over to 'Column Headers', (or whatever it's called), and add a column. Unless you're able to create an owner drawn listbox, I'd just set the column to about 200-300 less than the width of the listview. As long as you do not attempt to set it is Icon or Small Icon, I do not forsee a problem after taking these steps.