CodeItBetter Programming Another VB Programming Blog

How to set Form location and size at Run-Time

Posted on January 5, 2009
1
2
3
4
5
6
7
8
9
10
11
'Forms - How to set Form location and size at Run-Time

Option Explicit
 
Private Declare Function MoveWindow Lib "user32" (ByVal hwnd As Long, ByVal x As Long, _
    ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal bRepaint As Long) As Long
 
Private Sub Command1_Click()
    'Replace '250, 250, 400, 400' with the form co-ordinates.
    Call MoveWindow(Me.hwnd, 250, 250, 400, 400, 1)
End Sub
Filed under: Forms Leave a comment
Comments (0) Trackbacks (0)

No comments yet.


Leave a comment


 

No trackbacks yet.