How to Confine a Form to another Form
Posted on January 5, 2009
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | 'Forms - How to Confine a Form to another Form Option Explicit 'Add two forms to your project. Declare Function SetParent Lib "user32" (ByVal hWndChild As Long, ByVal hWndNewParent As Long) As Long 'Add the following code to your first form (named Form1): Private Sub Form_Load() Load Form2 Form2.Show End Sub 'Add the following code to your second form (named Form2): Private Sub Form_Load() SetParent Me.hWnd, Form1.hWnd End Sub |