Skip to content
MPGHThe Dark Arts
/
RegisterLog in
Forum
Community
What's NewLatest posts across the boardTrendingHottest threads right nowSubscribedThreads you follow
Discussion
GeneralIntroductionsEntertainmentDebate FortFlaming & Rage
Board
News & AnnouncementsMPGH TimesSuggestions & HelpGiveaways
More Sections
Art & Graphic DesignProgrammingHackingCryptocurrency
Hacks & Cheats
Games
ValorantCS2 / CS:GOCall of Duty / WarzoneFortniteApex LegendsEscape From Tarkov
+14 moreLeague of LegendsGTA VMinecraftRustROTMGBattlefieldTroveBattleOnCombat ArmsCrossFireBlackshotRuneScapeDayZDead by Daylight
Resources
Game Hacking TutorialsReverse EngineeringGeneral Game HackingAnti-CheatConsole Game Hacking
Tools
Game Hacking ToolsTrainers & CheatsHack/Release NewsNew
Submit a release →Share your cheat, tool, or config with the community.
AINEW
AI Tools
General & DiscussionPrompt EngineeringLLM JailbreaksHotAI Agents & AutomationLocal / Open Models
AI × Gaming
AI Aimbots & VisionML Anti-CheatGame Bots & Automation
Create
AI Coding / Vibe CodingAI Art & MediaAI Voice & TTS
The AI frontier →Where game hacking meets modern machine learning. Jump in.
Marketplace
Buy & Sell
SellingBuyingTradingUser Services
Trust & Safety
Middleman LoungeMarketplace TalkVouch Copy Profiles
Money
Cryptocurrency TalkCurrency ExchangeWork & Job Offers
Start selling →List accounts, services, and goods. Use the middleman to trade safe.
MPGH The Dark Arts

A community for offensive security research, reverse engineering, and AI.

Community

ForumMarketplaceSearch

Account

RegisterLog in

Legal

Privacy PolicyForum RulesHelp & FAQ
© 2026 MPGH · All rights reserved.Built by the community, for the community. For educational purposes onlyContent is shared for security research and education — we don't condone illegal use. You're responsible for complying with applicable laws. Use at your own risk.
Home › Forum › Programming › Visual Basic Programming › [Help]adding items to the listview code

[Help]adding items to the listview code

Posts 1–8 of 8 · Page 1 of 1
nathanael890
nathanael890
[Help]adding items to the listview code

guys. I need some help here.

if I want to add something to the listbox by this code
Code:
    Public Sub Add_Item( _
    ByVal Moderator As String, _
    ByVal User As String, _
    ByVal Type As String, _
    ByVal Points As String, _
    ByVal Reason As String)
        Dim Count As Integer = 0
        ListView1.Items.Add(Moderator)
        ListView1.Items(Count).SubItems.Add(User)
        ListView1.Items(Count).SubItems.Add(Type)
        ListView1.Items(Count).SubItems.Add(Points)
        ListView1.Items(Count).SubItems.Add(Reason)
        Count += 1
    End Sub
it just appears as 1 and it can't add other items no longer..
could someone solve this problem... thanks.
#1 · 15y ago
confict
confict
Where's the count function for ?
Why you dont just use
listview.items.add("") ?
#2 · 15y ago
Jason
Jason
Quote Originally Posted by confict View Post
Where's the count function for ?
Why you dont just use
listview.items.add("") ?
There is no count "function" there, and this sub is to simplify work obviously.

@OP
Okay first off, your logic is all wrong for the count variable.
[php]
Dim Count As Integer = 0
ListView1.Items.Add(Moderator)
ListView1.Items(Count).SubItems.Add(User)
ListView1.Items(Count).SubItems.Add(Type)
ListView1.Items(Count).SubItems.Add(Points)
ListView1.Items(Count).SubItems.Add(Reason)
Count += 1
[/php]

Let's see...every time you call the sub you're declaring an integer with a value of 0, so it's going be 0 all the time...

Instead try:

[php]
Public Sub Add_Item( _
ByVal Moderator As String, _
ByVal User As String, _
ByVal Type As String, _
ByVal Points As String, _
ByVal Reason As String)
Dim Count As Int32 = Me.ListView1.Items.Count-1
ListView1.Items.Add(Moderator)
ListView1.Items(Count).SubItems.Add(User)
ListView1.Items(Count).SubItems.Add(Type)
ListView1.Items(Count).SubItems.Add(Points)
ListView1.Items(Count).SubItems.Add(Reason)
End Sub
[/php]

That should work.

EDIT: For the sake of a better explanation + I'm bored:

By changing count to "Me.ListBiew1.Items.Count-1" you've assigned the variable "count" to a dynamic value that will change as more items are added, rather than a static "0" which will never change which resulted in you finding it kept overwriting previous entries right?
#3 · edited 15y ago · 15y ago
confict
confict
Quote Originally Posted by Jason View Post


There is no count "function" there, and this sub is to simplify work obviously.

@OP
Okay first off, your logic is all wrong for the count variable.
[php]
Dim Count As Integer = 0
ListView1.Items.Add(Moderator)
ListView1.Items(Count).SubItems.Add(User)
ListView1.Items(Count).SubItems.Add(Type)
ListView1.Items(Count).SubItems.Add(Points)
ListView1.Items(Count).SubItems.Add(Reason)
Count += 1
[/php]

Let's see...every time you call the sub you're declaring an integer with a value of 0, so it's going be 0 all the time...

Instead try:

[php]
Public Sub Add_Item( _
ByVal Moderator As String, _
ByVal User As String, _
ByVal Type As String, _
ByVal Points As String, _
ByVal Reason As String)
Dim Count As Int32 = Me.ListView1.Items.Count-1
ListView1.Items.Add(Moderator)
ListView1.Items(Count).SubItems.Add(User)
ListView1.Items(Count).SubItems.Add(Type)
ListView1.Items(Count).SubItems.Add(Points)
ListView1.Items(Count).SubItems.Add(Reason)
End Sub
[/php]

That should work.

EDIT: For the sake of a better explanation + I'm bored:

By changing count to "Me.ListBiew1.Items.Count-1" you've assigned the variable "count" to a dynamic value that will change as more items are added, rather than a static "0" which will never change which resulted in you finding it kept overwriting previous entries right?
Thanks for the explanation
I never worked with listview so I just gave it a try ^^
#4 · 15y ago
Blubb1337
Blubb1337
[php] Dim Count As Int = 0
ListView1.Items.Add(Moderator)
Count = ListView1.Items.Count-1
ListView1.Items(Count).SubItems.Add(User)
ListView1.Items(Count).SubItems.Add(Type)
ListView1.Items(Count).SubItems.Add(Points)
ListView1.Items(Count).SubItems.Add(Reason) [/php]

Else, the first count will be -1.
#5 · 15y ago
'Bruno
'Bruno
Just create the item variable, add subitems to it.. and then add that item to the list... :\ no need for all that stuff
#6 · 15y ago
Jason
Jason
Oops thanks for that little error fix Kevin, turns out I had the the fail logic.
#7 · 15y ago
nathanael890
nathanael890
thanks for the codes guys. I just tried to create my program for managing a forum because I'm also a moderator of it. so I want to record my status on it ^^

*Solved
#8 · 15y ago
Posts 1–8 of 8 · Page 1 of 1

Post a Reply

Similar Threads

  • Please help me i want the boxes code and dunno how i use them plss tell meBy willeman in Combat Arms Coding Help & Discussion
    1Last post 15y ago
  • need the game code install help!By tricks1 in Call of Duty Modern Warfare Help
    4Last post 16y ago
  • Hello! i need help with the source code.By LatinHacker in Combat Arms Help
    3Last post 16y ago
  • help and request i nid source code of the public hack of dave last MAYBy rockerboi in CrossFire Help
    4Last post 16y ago
  • [HELP] Adding new items in QChaosZombieMod in shopBy xurple in Call of Duty Modern Warfare 2 GSC Modding Help/Discussion
    4Last post 16y ago

Tags for this Thread

None