我有这个代码,它有一个错误if carloc = (250,524)
。代码是检查汽车(图片框)是否在某个地方,然后在您按下“A”时将 ti 移动到其他地方。这是代码:
Public Class Form1
Dim carloc As Point
Private Sub Form1_KeyDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles MyBase.KeyDown
Select e.KeyCode
Case Keys.A
If carloc = (250,524) then
carloc = New Point(285, 524)
car.Location = carloc
End If
End Select
End Sub
结束类