Oct 28th, 2008, 11:44 AM
[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.
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...
Dim slots(3) As Label
in the form load you now need to set each the array to find the labels. So follow the pattern...
Dim slots(9) As Label
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:
if you'r following the example of 10 slots then you change the 3 to a 9.
Also change the line:
index = 5 'Stops t...
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.
Last edited by oppdelta; Oct 28th, 2008 at 12:26 PM.
Reason: Removed Compiled Code From Attachment
Click Here to Expand Forum to Full Width
Survey posted by VBForums.