Mirage Source
Vbkey open/close - Printable Version

+- Mirage Source (https://mirage-engine.uk/forums)
+-- Forum: Mirage Source (Nostalgia) (https://mirage-engine.uk/forums/forumdisplay.php?fid=61)
+--- Forum: Archive (2006-2011) (https://mirage-engine.uk/forums/forumdisplay.php?fid=18)
+---- Forum: General (https://mirage-engine.uk/forums/forumdisplay.php?fid=17)
+---- Thread: Vbkey open/close (/showthread.php?tid=1814)



Vbkey open/close - Kay-No - 04-06-2008

Hello, im using vbkey's to open players inventory and such.
But i what i got stuck at is how to make the second time the player presses the key, the pic will close.

Ex. You press "i" and the inventory opens.
Then you hit "i" again and the inventory closes
Pretty simple? Smile

This is the piece of code im using.
Code:
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
    If (KeyCode = vbKeyI) Then
       picPlayerInventory.Visible = True
    End If
End Sub