I am kind of new to programming so this question is probably simple to most of you but I am stumped.
I am writting a program in which the user watches a picture scroll across the screen and then stops in the middle and at this time they must spell what the picture is. Where I have run into a problem is allowing the keyboard input. When the picture gets to the middle of the screen it beeps and you cannot press a key or anything. This is the code I have so far. I have more Cases of pictures but I did not put them here. any help would be greatly appreciated. Thank you
Private Sub Form_Load()
Picture1.Picture = LoadPicture("D:\letter factory\click to start.jpg"
End Sub
Private Sub mnuExit_Click()
End
End Sub
Private Sub text1_KeyPress()
Dim KeyAscii As Integer
If KeyAscii = 65 Then 'waits for letter A to be pressed
Print "" 'prints blank space
Print "" 'prints blank space
Print "" 'prints blank space
Print Spc(5); "A" ' 'moves 5 spaces and then prints letter"
Else
Beep
End If
End Sub
Private Sub Picture1_click()
Dim pic As Picture
Dim X As String
Dim rand As String
Dim keystate As Integer
Randomize Timer
rand = Int(Rnd * 20) + 1
Select Case rand
Case Is = 1
Set pic = LoadPicture("D:\letter factory\pic1.jpg"
Picture1.Picture = pic
X = 9000
Do While X > 5000
Picture1.Move (X)
X = X - 0.1
Loop
Call text1_KeyPress
I am writting a program in which the user watches a picture scroll across the screen and then stops in the middle and at this time they must spell what the picture is. Where I have run into a problem is allowing the keyboard input. When the picture gets to the middle of the screen it beeps and you cannot press a key or anything. This is the code I have so far. I have more Cases of pictures but I did not put them here. any help would be greatly appreciated. Thank you
Private Sub Form_Load()
Picture1.Picture = LoadPicture("D:\letter factory\click to start.jpg"
End Sub
Private Sub mnuExit_Click()
End
End Sub
Private Sub text1_KeyPress()
Dim KeyAscii As Integer
If KeyAscii = 65 Then 'waits for letter A to be pressed
Print "" 'prints blank space
Print "" 'prints blank space
Print "" 'prints blank space
Print Spc(5); "A" ' 'moves 5 spaces and then prints letter"
Else
Beep
End If
End Sub
Private Sub Picture1_click()
Dim pic As Picture
Dim X As String
Dim rand As String
Dim keystate As Integer
Randomize Timer
rand = Int(Rnd * 20) + 1
Select Case rand
Case Is = 1
Set pic = LoadPicture("D:\letter factory\pic1.jpg"
Picture1.Picture = pic
X = 9000
Do While X > 5000
Picture1.Move (X)
X = X - 0.1
Loop
Call text1_KeyPress