要用键盘上的上下左右四个键来控制picturebox的移动,请问代码怎么打?

2024-11-17 23:55:29
推荐回答(1个)
回答1:

Private Sub Picture1_KeyUp(KeyCode As Integer, Shift As Integer) Select Case KeyCode Case 39 Picture1.Move Picture1.Left + 100 Case 37 Picture1.Move Picture1.Left - 100 Case 38 Picture1.Move Picture1.Left, Picture1.Top - 100 Case 40 Picture1.Move Picture1.Left, Picture1.Top + 100 End Select End Sub