新建From1(窗体),新建Command1到5(按钮CommandButton),代码:
Private Sub Command1_Click() '设置窗体在桌面左下角
Me.Top = Screen.Height - Me.Height
Me.Left = 0
End Sub
Private Sub Command2_Click() '设置窗体在桌面左上角
Me.Top = 0
Me.Left = 0
End Sub
Private Sub Command3_Click() '设置窗体在桌面右上角
Me.Top = 0
Me.Left = Screen.Width - Me.Width
End Sub
Private Sub Command4_Click() '设置窗体在桌面中央
If WindowState = 0 Then
Move (Screen.Width - Form1.Width) / 2, (Screen.Height - Form1.Height) / 2
End If
End Sub
Private Sub Command5_Click() '设置窗体在桌面右下角
Me.Top = Screen.Height - Me.Height
Me.Left = Screen.Width - Me.Width
End Sub