Private Sub Form_Load() '----------------------------------------- '可随意设置此处me.left和me.top的值 Me.Left = 500 Me.Top = 800 '----------------------------------------- If Me.Top < 0 Then Me.Top = 0 If Me.Left < 0 Then Me.Left = 0 If Me.Top + Me.Height >= Screen.Height Then Me.Top = Screen.Height - Me.Height End If If Me.Left + Me.Width >= Screen.Width Then Me.Left = Screen.Width - Me.Width End If End Sub