maximize the MDI child

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jassim Rahma

    #1

    maximize the MDI child

    how can I maximize the MDI child in the free MDI parent area not in the
    whole window.. I mean in the (whole window area - menubar - tool bar) so i
    want the MDi child to show its whole window and caption bar within the MDI
    container.

  • Peter Duniho

    #2
    Re: maximize the MDI child

    Jassim Rahma wrote:
    how can I maximize the MDI child in the free MDI parent area not in the
    whole window.. I mean in the (whole window area - menubar - tool bar) so
    i want the MDi child to show its whole window and caption bar within the
    MDI container.
    I don't know that you can. The general point of the maximize behavior
    for an MDI child is that the caption bar gets merged with the menu of
    the parent window.

    However, you could simulate the behavior by checking the WindowState in
    the OnResize method of your child form, and if it's Maximized, manually
    reset the WindowsState to Normal and adjust the window size and position
    to fit where you want it.

    I played with this a little, and found that by insetting the parent's
    ClientRectangle 5 pixels in width and height, that accounted for the
    internal frame you get when a form is an MdiContainer. There might be a
    direct way to get these metrics, but if there is I don't know.

    For that matter, I haven't done any MDI stuff other than to fiddle
    around with it, so I suppose there's a better, more-approved way to
    avoid the merging behavior. But if there is, I don't see it.

    Pete

    Comment

    • =?Utf-8?B?QWRyaWFuIFZvaWN1?=

      #3
      RE: maximize the MDI child


      You could set the WindowState of the MDI child to FormWindowState .Maximized
      when the form loads or when the user presses a button for example. Another
      thing you could also do is set the Dock property of the MDI child to
      DockStyle.Fill, again depending on what you want to do.

      Adrian.
      --
      [Please mark my answer if it was helpful to you]




      "Jassim Rahma" wrote:
      how can I maximize the MDI child in the free MDI parent area not in the
      whole window.. I mean in the (whole window area - menubar - tool bar) so i
      want the MDi child to show its whole window and caption bar within the MDI
      container.
      >

      Comment

      • Jassim Rahma

        #4
        Re: maximize the MDI child


        docking worked...

        thank you very much..


        "Adrian Voicu" <AdrianVoicu@di scussions.micro soft.comwrote in message
        news:BE385750-CDD7-4A87-B6CD-94E6B8D5DB3F@mi crosoft.com...
        >
        You could set the WindowState of the MDI child to
        FormWindowState .Maximized
        when the form loads or when the user presses a button for example. Another
        thing you could also do is set the Dock property of the MDI child to
        DockStyle.Fill, again depending on what you want to do.
        >
        Adrian.
        --
        [Please mark my answer if it was helpful to you]
        >
        >
        >
        >
        "Jassim Rahma" wrote:
        >
        >how can I maximize the MDI child in the free MDI parent area not in the
        >whole window.. I mean in the (whole window area - menubar - tool bar) so
        >i
        >want the MDi child to show its whole window and caption bar within the
        >MDI
        >container.
        >>

        Comment

        • Jassim Rahma

          #5
          Re: maximize the MDI child

          how can i make sure the MDI child will be docked when the user clicked on
          the maximize button without it's being maximized first!! I tried this but
          didn't work.

          private void TerminalForm_Re sizeBegin(objec t sender, EventArgs e)
          {
          if (this.WindowSta te == FormWindowState .Maximized)
          {
          this.Dock = DockStyle.Fill;
          }
          }



          "Adrian Voicu" <AdrianVoicu@di scussions.micro soft.comwrote in message
          news:BE385750-CDD7-4A87-B6CD-94E6B8D5DB3F@mi crosoft.com...
          >
          You could set the WindowState of the MDI child to
          FormWindowState .Maximized
          when the form loads or when the user presses a button for example. Another
          thing you could also do is set the Dock property of the MDI child to
          DockStyle.Fill, again depending on what you want to do.
          >
          Adrian.
          --
          [Please mark my answer if it was helpful to you]
          >
          >
          >
          >
          "Jassim Rahma" wrote:
          >
          >how can I maximize the MDI child in the free MDI parent area not in the
          >whole window.. I mean in the (whole window area - menubar - tool bar) so
          >i
          >want the MDi child to show its whole window and caption bar within the
          >MDI
          >container.
          >>

          Comment

          Working...