Results 1 to 5 of 5

Thread: SetParent: how to make a child window?

  1. #1

    Thread Starter
    Fanatic Member TheVader's Avatar
    Join Date
    Oct 2002
    Location
    Rotterdam, the Netherlands
    Posts
    871

    Arrow SetParent: how to make a child window?

    Hi folks,

    I'm trying to display a form inside another form. It's more or less the same as using an MDIForm, but I'd like not to use one because of the lousy positioning of the child forms.

    With the SetParent API I can easily let one form host another, but the problem is that when the hosted form has the focus, the hosting form's title bar is gray. This is bad for the consistency of the interface. Does anyone know how to make the hosting form remain its focus?

    Check out the attached example, it's a very simple illustration.

    Thanks.
    Attached Files Attached Files
    Author for Visual Basic Web Magazine

    My articles on the Web Browser Control:
    Using the Web Browser Control & Using the DHTML Document Object Model

    The examples referenced in the articles can be found here:

  2. #2
    Super Moderator Wokawidget's Avatar
    Join Date
    Nov 2001
    Location
    Headingly Occupation: Classified
    Posts
    9,632
    You can, but it's complicated and messy.
    Why bother?
    What do you mean "the positioning"?
    You can write a tiny bit of code that would position a child form automatically when it's loaded.

    Hang on, I'll write you some code.

    Woof

  3. #3

  4. #4

    Thread Starter
    Fanatic Member TheVader's Avatar
    Join Date
    Oct 2002
    Location
    Rotterdam, the Netherlands
    Posts
    871
    Thanks Woka, I'll check it out. Actually you're right, an MDIForm is easier. But because I started the project using a normal form I more or less forgot about the ability of using an MDIForm. My original idea is in fact overly complicated.
    Author for Visual Basic Web Magazine

    My articles on the Web Browser Control:
    Using the Web Browser Control & Using the DHTML Document Object Model

    The examples referenced in the articles can be found here:

  5. #5

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