Results 1 to 2 of 2

Thread: SetParent problem

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Sep 1999
    Location
    Guayaquil, Guayas, Ecuador
    Posts
    87
    If i create a form1 with a picture box, and set the parent to another form2 to that picture box, it integrate to that picture box like mdiform BUT when i try to move the form2 that is inside the picture box, it muves like if it is crazy

    Does anyone know how to correct it please?

  2. #2
    Hyperactive Member
    Join Date
    Jan 1999
    Location
    Rotterdam, Netherlands
    Posts
    386
    Without code we can't see what might be wrong..
    But this is what I use in a program:
    Code:
    Public Sub Make_Child_Window(f As Form)
        Dim l As Long
        l = GetWindowLong(f.hWnd, GWL_STYLE)
        l = l Or WS_CHILD
        SetWindowLong f.hWnd, GWL_STYLE, l
        SetParent f.hWnd, picFrame.hWnd
        f.Left = 0
        f.Top = 0
        f.Width = picFrame.ScaleWidth
        f.Height = picFrame.ScaleHeight
    End Sub
    Where picFrame is the parent-picturebox I use for that.
    Check the API textviewer for the declarations.
    Oh and I use borderless forms for this.
    Hope this helps

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width