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 |