[求助]调皮的按钮~
Dim y As Integer
Dim x As Integer
Private Sub Command2_Click()
Command1.Left = Command1.Left + x
Command1.Top = Command1.Top + y
If Command1.Left <= 0 Or Command1.Left + Command1.Width >= Form1.Width Then x = -x
If Command1.Top <= 0 Or Command1.Top + Command1.Height >= Form1.Height Then y = -y
End Sub
Private Sub Form_Load()
Randomize
x = 300 * Rnd
y = 300 * Rnd
End Sub
点command2 command1就开始移动一下,怎么样,可以点 command2,command1就一直移动,好象一直在点commadn2一样?