'右边检查 if Image1.left > me.scalewidth - image1.width then '不移动 else Image1.Left = Image1.Left + 10 end if 其他的方向,类似
还是有问题............可否帖其他方向的代码?我用下面这代码 Select Case KeyCode Case 39 If Image1.Left > Me.ScaleWidth - Image1.Width Then '不移动 Else Image1.Left = Image1.Left + 30 End If
'右边检查
if Image1.left > me.scalewidth - image1.width then
'不移动
else
Image1.Left = Image1.Left + 10
end if
其他的方向,类似
Select Case KeyCode
Case 39
If Image1.Left > Me.ScaleWidth - Image1.Width Then
'不移动
Else
Image1.Left = Image1.Left + 30
End If