CodeItBetter Programming Another VB Programming Blog

How to Align the Form to the Left/Center/Right

Posted on January 5, 2009
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
'Forms - How to Align the Form to the Left/Center/Right

Option Explicit
 
Private Sub Command1_Click()
    Form1.Left = 0
    Form1.Top = Screen.Height / 2 - Form1.Height / 2
End Sub
 
Private Sub Command2_Click()
    Form1.Left = Screen.Width / 2 - Form1.Width / 2
    Form1.Top = Screen.Height / 2 - Form1.Height / 2
End Sub
 
Private Sub Command3_Click()
    Form1.Left = Screen.Width - Form1.Width
    Form1.Top = Screen.Height / 2 - Form1.Height / 2
End Sub
Filed under: Forms Leave a comment
Comments (0) Trackbacks (0)

No comments yet.


Leave a comment


 

No trackbacks yet.