Does anyone know of a good tutorial on Flags update in a Listview? and all that stuff?
VB
VB 6
If (Flags And BNFLAGS_OP) = BNFLAGS_OP Then
frmMain.lvChannel.ListItems.Remove frmMain.lvChannel.FindItem(Username).Index
With frmMain.lvChannel.ListItems.Add(1, , Username, , ICON_GAVEL)
.ListSubItems.Add 1, , , GetLagIcon(Ping, Flags)
End With
Else
With frmMain.lvChannel
.ListItems(.FindItem(Username).Index).SmallIcon = icon
End With
End If
Open up your favorite visual basic book and read the section on the bitwise operators, paying special attention to the AND, &, operator. The AND operator will tell you whether a bit is turned on, 1, or not.
The code above is correct and does what it is supposed to do.
I never said the code above was incorrect. He did however ask for a tutorial, as in something to teach him, on how to make his flags work. You responded with code, which works, and I responded with a way to learn about what you posted. See the difference? How will it help him to use code he may not understand?
Yeah, I didn't know who you were talking to, and he can look it up on MSDN.
Quote from: bmwrb16 on October 27, 2003, 04:28 PM
Yeah, I didn't know who you were talking to, and he can look it up on MSDN.
Stop being a jerk. You both gave valid answers.
If want some help on Flags Look in Bnet docs on the main page...Or you can aim me on Phyc0freek and ill help you
Quote from: bmwrb16 on October 27, 2003, 03:00 PM
The code above is correct and does what it is supposed to do.
It is not however a tutorial so it's obviously completely utterly failing to answer a question asking for a tutorial instead of a code sample.
http://www.valhallalegends.com/arta/docs/flags.txt
Quote
If (BattleNetFlag And FlagValue) = BattleNetFlag Then
' flag is set
Else
' flag is not set
End If
if the flag's set, update the icon on your listview, if not, leave it how it is
Quote from: Tuberload on October 27, 2003, 02:52 PM
Open up your favorite visual basic book and read the section on the bitwise operators, paying special attention to the AND, &, operator. The AND operator will tell you whether a bit is turned on, 1, or not.
bitmasking is the term, I believe. (just in case you want to look this up)
Quote from: Gangz on October 27, 2003, 04:42 PM
If want some help on Flags Look in Bnet docs on the main page...Or you can aim me on Phyc0freek and ill help you
He wasn't asking for help with the flags I think he meant the event.
Quote from: Adron on October 27, 2003, 05:37 PM
Quote from: bmwrb16 on October 27, 2003, 03:00 PM
The code above is correct and does what it is supposed to do.
It is not however a tutorial so it's obviously completely utterly failing to answer a question asking for a tutorial instead of a code sample.
Well his question was kind of ambiguous so I just gave a code sample of the "flagsupdate_event".
Quote from: UserLoser on October 27, 2003, 05:43 PM
http://www.valhallalegends.com/arta/docs/flags.txt
Quote
If (BattleNetFlag And FlagValue) = BattleNetFlag Then
' flag is set
Else
' flag is not set
End If
Basically what i said, the code I posted covers all the flags if your "GetIconCode" function is made properly
Quote from: Etheran on October 27, 2003, 05:52 PM
Quote from: Tuberload on October 27, 2003, 02:52 PM
Open up your favorite visual basic book and read the section on the bitwise operators, paying special attention to the AND, &, operator. The AND operator will tell you whether a bit is turned on, 1, or not.
bitmasking is the term, I believe. (just in case you want to look this up)
Not really since bitmasking is different then bitwise.
QuoteNot really since bitmasking is different then bitwise.
bitmasking is a bitwise function?
QuoteBasically what i said, the code I posted covers all the flags if your "GetIconCode" function is made properly
btw, you mean MY GetIconCode function.