Private Sub Form_KeyPress(KeyAscii As Integer)
If KeyAscii = vbKeyUp Then
End
End If
If KeyAscii = vbKeyRight Then
Shape1.Left = Shape1.Left + 480
End If
If KeyAscii = vbKeyLeft Then
Shape1.Left = Shape1.Left - 480
End If
End Sub
我試過打以上的文字,但不能用keybroad控制program。
請問尚有何方法?
thx~
If KeyAscii = vbKeyUp Then
End
End If
If KeyAscii = vbKeyRight Then
Shape1.Left = Shape1.Left + 480
End If
If KeyAscii = vbKeyLeft Then
Shape1.Left = Shape1.Left - 480
End If
End Sub
我試過打以上的文字,但不能用keybroad控制program。
請問尚有何方法?
thx~
文章標籤
全站熱搜

Function Key 必須在 KeyDown 或 KeyUp 事件中用 KeyCode 來判別.
不好意思..... 我是個初哥..... 有點不太明白....可不可以說詳述一點....thx~
Private Sub Form_KeyDown(KeyACode As Integer,Shift as int) If KeyACode = vbKeyUp Then End End If If KeyACode = vbKeyRight Then Shape1.Left = Shape1.Left + 480 End If If KeyACode = vbKeyLeft Then Shape1.Left = Shape1.Left - 480 End If End Sub
THX~