Originally 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......
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.net
VB Code:
  1. Private Declare Function SetParent Lib "user32" (ByVal hWndChild As Long, ByVal hWndNewParent As Long) As Long
  2.  
  3. Private Sub Command1_Click()
  4. Load Form1
  5. Me.ScaleMode = Form1.ScaleMode
  6. Form1.Left = Command1.Left
  7. Form1.Top = Command1.Top + Command1.Height
  8. Form1.Show
  9. SetParent Form1.hWnd, Me.hWnd
  10. End Sub
HTH