[VB 2005] Game Inventory-VBForums
Results 1 to 3 of 3

Thread: [VB 2005] Game Inventory

  1. #1

    Thread Starter
    Member
    Join Date
    Oct 2008
    Posts
    40

    Post [VB 2005] Game Inventory

    Hi this is a simple inventory that can be used on small games.

    If you are newish to VB then read on.


    It at the moment has 4 slots but you can add more by (lets run on the example of "10" slots you want:

    Now add the labels on the form. Naming each one. (The first 4 are already done) lblslot5, lblslot6, lblslot7........ lblslot10

    Once done then go into the code and Look for the line near the top.
    Code:
    Dim slots(3) As Label
    Since this is an array. You take 1 from the full amount you want. So if you want 10 slots then you put in the () 9 so...
    Code:
    Dim slots(9) As Label
    in the form load you now need to set each the array to find the labels. So follow the pattern...


    slots(0) = lblSlot1
    slots(1) = lblSlot2
    slots(2) = lblSlot3
    slots(3) = lblSlot4

    ....

    slots(9) = lblSlot10



    until you get to lblSlot10.

    Now the last thing is to change the number in the loop... look for the line:
    Code:
    For index = 0 To 3
    if you'r following the example of 10 slots then you change the 3 to a 9.
    Also change the line:

    Code:
    index = 5 'Stops t...
    to:

    Code:
    index = 100

    Hope this makes sense. Wasnt that good at explaining things. If you need help just email or PM me. Cheers...

    And yes i know it simple. But people gotta start off somewhere.
    Attached Files Attached Files
    Last edited by oppdelta; Oct 28th, 2008 at 11:26 AM. Reason: Removed Compiled Code From Attachment

  2. #2
    Super Moderator Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,334

    Re: [VB 2005] Game Inventory

    Thank you for your CodeBank submission.

    In accordance with this CodeBank policy regarding attachments, I have edited yours and removed all compiled files.

    Please post only source code in any CodeBank attachment.

    Thank you.
    Please use [Code]your code goes in here[/Code] tags when posting code.
    When you have received an answer to your question, please mark it as resolved using the Thread Tools menu.
    Before posting your question, did you look here?
    Got a question on Linux? Visit our Linux sister site.
    I dont answer coding questions via PM or EMail. Please post a thread in the appropriate forum section.

    Creating A Wizard In VB.NET
    Paging A Recordset
    What is wrong with using On Error Resume Next
    Good Article: Language Enhancements In Visual Basic 2010
    Upgrading VB6 Code To VB.NET
    Microsoft MVP 2005/2006/2007/2008/2009/2010/2011/2012/Defrocked

  3. #3

    Thread Starter
    Member
    Join Date
    Oct 2008
    Posts
    40

    Re: [VB 2005] Game Inventory

    Ah sorry, when you say compiling. That meaning the exe or somthing? Sorry for being a noob here...


    EDIT: OH wait i know what you mean XD
    Last edited by oppdelta; Oct 28th, 2008 at 05:39 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width

Survey posted by VBForums.