As subraven mentioned, the Left and Top properties have to be use to align the form. To ensure that the second form does not leave the screen area of the first form, the SETPARENT api call is used. You can know more about api calls at http://www.allapi.netOriginally posted by CagedConfession
Cool, i did get the form to pop up. Now how do I get it to align its self automatically under the button itself. For instance when the program itself is moved around on the screen i want the box to stay under the button when pressed. Thanks for your help......This is probally just the beggining of my questions. But i'll try not to bother u guys to much......
HTHVB Code:
Private Declare Function SetParent Lib "user32" (ByVal hWndChild As Long, ByVal hWndNewParent As Long) As Long Private Sub Command1_Click() Load Form1 Me.ScaleMode = Form1.ScaleMode Form1.Left = Command1.Left Form1.Top = Command1.Top + Command1.Height Form1.Show SetParent Form1.hWnd, Me.hWnd End Sub




Reply With Quote