Thread: Game and keys
View Single Post
  #12 (permalink)  
Old 06-01-2008, 03:50 PM
pmu5757's Avatar
pmu5757 pmu5757 is offline
Knows the basics
 
Join Date: Sep 2007
Location: Metz (France)
Posts: 53
Default

Thank you Erel, but I don't succeed in coding that.
Here is my code (in fact too attempts in the same code but neither the one nor the other works).
Could you tell me what's wrong : I just want to make the button move by typing on the arrows.
Thank you.

Code:
Sub Globals
	'Declare the global variables here.

End Sub

Sub App_Start
	Form1.Show
	Button1.Focus
	End Sub


Sub Button1_KeyPress (key)
	If Key=cUpKey Then
		Button1.Top=Button1.Top+5
	End If
End Sub

Sub Form1_KeyPress (specialKey)
	Select SpecialKey
 Case cUpKey
  Button1.Top=Button1.Top+5
 Case cDownKey
 Button1.Top=Button1.Top-5
End Select
End Sub
__________________
Pascal
Reply With Quote