Re: Creating different actions for every time you press a key



On May 21, 11:51 am, "Desserten" <***...@xxxxxxxxxxxxxxx> wrote:
"Fireseeker" <fireseeker_1...@xxxxxxxxxxx> skrev i en meddelelsenews:1179761118.575015.174210@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Hello there .. sorry the title might have been a bit confusing. Well
let me explain. I am making a program and I want to make it so that a
label changes caption every time the user presses the Space key .. I
tried doing this .. which is prebably wrong :P But please help me ..
This is my code

REMEMBER to set your form's KeyPreview to TRUE in properties

Private Sub Form_KeyPress(KeyAscii As Integer)
Select Case KeyAscii
Case 32
Label1.Caption = "ENTER"
End Select
End Sub

Thank you oh so very much!! It worked!! but i still have a problem ..
i do that and after i press Spacebar .. the text changes .. but I need
it to change more than once .. so i did this ..

Private Sub Form_KeyPress(KeyAscii As Integer)
Select Case KeyAscii
Case 32
pl1i.Visible = False
pl2i.Visible = True
Case 32
pl2i.Visible = False
civil1.Visible = True
Case 32
pl2i.Visible = False
civil1.Visible = True
End Select
End Sub

*NOTE: Im doing visible = true and false because the text is already
there .. i just need to make it visible for the user to see *

So .. i try this and it doesnt work :( It works if I press it once but
the next two times it doesnt .. help please!!


Fireseeker

.