CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Sep 1999
    Posts
    14

    Start position of child form

    Can any one tell me why when I run a project with a MDIForm and child forms, the child forms doesn't start in the upper left corner of the MDIForm? I set all the child form to (top = 0). Is there another property that I'm missing.


  2. #2
    Join Date
    May 1999
    Posts
    3,332

    Re: Start position of child form

    set the top property in the MDIChild form in the Form_Load event and it will work.
    Windows assumes a default positioning sequence when creating MDI children.


  3. #3
    Guest

    Re: Start position of child form

    In VB6, at least. Even if you set the position of a child window in an
    MDI to be anything other than 0 - Manual, you'll find that it reverts to
    0 - Manual anyway each time you access it.

    I found it far easier to just set the Top and Left properties of each child
    form to 0 in their respective Form_Load events.


  4. #4
    Join Date
    May 1999
    Location
    Omika, Japan
    Posts
    729

    Re: Start position of child form

    You can also set AutoSHowChildren Property of MDI to False. This will not show the child forms when you load.
    So after loading, set its top & left properties, and then show. ie. all the code is in MDI itself
    Ex: On some menu item seleciton:

    dim tmpFrm as ChildFrm1
    ' set some properties, if you have

    load tmpFrm
    tmpFrm.Move 0,0 ' faster, only one resize event in child form
    ' set some more properties .. and then
    tmpfrm.show
    set tmpfrm = nothing




    RK

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

Featured