# 试试这个!

Posted by 大汉堡 on August 28, 1999 at 01:35:58:

In Reply to: 请问个问题... posted by 小T on August 27, 1999 at 18:15:32:

Dim z As Integer
Private Sub Form_Click() '停止/移动表单
Timer1.Enabled = Not Timer1.Enabled
End Sub
Private Sub Form_Load()
Timer1.Interval = 1 '设定移动速度
Timer1.Enabled = True
Form1.Top = 0
Form1.Left = 0
z = 200 '设定移动速度
End Sub
Private Sub Timer1_Timer()
If Form1.Top <= 0 Then
Form1.Left = Form1.Left + z
End If
If Form1.Width + Form1.Left >= Screen.Width Then
Form1.Top = Form1.Top + z
End If
If Form1.Top + Form1.Height >= Screen.Height Then
Form1.Left = Form1.Left - z
End If
If Form1.Left <= 0 Then
Form1.Top = Form1.Top - z
End If
End Sub

Follow Ups: