Results 1 to 2 of 2

Thread: SetParent doesn't work for MDIForms

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Oct 2001
    Location
    didn't decide yet
    Posts
    566

    SetParent doesn't work for MDIForms

    i tried to use SetParent to make a non MdiChild form to a MDIChild one the job was done but the new MDIChild does not behave like an actuall one. Does ne1 know another way of showing a non MDI form as a MDIChild?

    thnks
    Come and get our ISDN CallerID http://www.3wm.biz

  2. #2
    Junior Member
    Join Date
    Apr 1999
    Location
    Tampa, FL
    Posts
    23
    SetParent alone will work, but your right -- it won't act like a regular child window. You might want to try this code and see if it works for you. It basically tells a window to change into a child.
    Code:
    Public Sub MakeChildWindow(hWnd As Long)
    Dim lngStyle As Long
        lngStyle = GetWindowLong(hWnd, GWL_STYLE)
        lngStyle = ((lngStyle And Not WS_POPUP) Or WS_CHILD)
        SetWindowLong hWnd, GWL_STYLE, lngStyle
    End Sub
    Hope this was helpful.

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