Jared
Tue Jan 16 11:01:38 CST 2007
Not to beat a dead horse, but docking the border panels didn't work for
me because that would put them on the "outside" of the MdiClient.
Which means it would be two pixels taller than the section next to it
(one on top, one on bottom) and wouldn't line up visually.
I must've tried about 10 different approaches before finally settling
on this solution. I set the z-order at Form_Load to make sure they're
on top of the MdiClient, then just reposition them as needed. Normally
I'd fight with it a little longer, but this seems to do the trick. =)
I like the custom graphics on the right side of the form caption bars
in your examples. Can you point me to a url that explains how to do
that?
Jared
Mick Doherty wrote:
> Your solution is probably as good as any.
>
> You can dock the "border panels" and then use the SendToBack and
> BringToFront commands to get the correct zOrder. This will do away with the
> need to reposition them at resize events.
>
> --
> Mick Doherty
>
http://dotnetrix.co.uk/nothing.html
>
>
> "Jared" <google@tripletreesoftware.com> wrote in message
> news:1168914035.652121.102260@a75g2000cwd.googlegroups.com...
> > Hi Mick,
> >
> > I've had the MDI client area docked all along, but I wanted to improve
> > the look of the UI. I did so by removing the 3D border, but I couldn't
> > find a way to replace it with a nice 1-pixel custom border. Normally I
> > would do this by nesting the control inside a Panel with
> > DockPadding.All = 1. In the case of MdiClient, however, this detaches
> > it from its Form and creates some pretty weird behavior (as described
> > above).
> >
> > I'm sure there's a better way to accomplish this (like capturing
> > Windows messages and painting the border on the MdiClient control), but
> > I managed to solve my problem the low-tech way by creating four thin
> > Panels that act as the borders. I reposition them during the
> > MdiClient's Resize and LocationChanged events. Works great.
> >
> > See a sample at:
> >
http://www.tripletreesoftware.com/images/google_sample.jpg
> >
> > Jared
> >
> >
> > Mick Doherty wrote:
> >> Why do you need to re-Parent the MDIClient?
> >>
> >> You can dock Panels to the MDIForm to allow other controls to be added to
> >> the view. Docking the panels modifies the MDIClient Area so that MDI
> >> Child
> >> Forms will not obscure them.
> >>
> >> There is an example on my site which shows this behaviour.
> >>
http://www.dotnetrix.co.uk/mdi.html
> >>
> >> --
> >> Mick Doherty
> >>
http://dotnetrix.co.uk/nothing.html
> >>
> >>
> >> "Jared" <google@tripletreesoftware.com> wrote in message
> >> news:1168806420.842301.259120@l53g2000cwa.googlegroups.com...
> >> >I programmatically moved the MdiClient of my MDI form to be nested
> >> > inside a Panel so I can control the layout better. I also removed the
> >> > 3D border on the MdiClient using Interop.
> >> >
> >> > When trying to open MDI child forms, I first received an error about
> >> > the parent not being an MDI container. I suspected this was because I
> >> > moved the MdiClient, so I set IsMdiContainer back to true after the
> >> > move. I no longer get the error, but now the MDI children don't
> >> > display at all.
> >> >
> >> > I'm assuming I need to hook the MdiClient back up to the parent form
> >> > somehow. How do I do this while keeping the MdiClient nested in a
> >> > Panel?
> >> >
> >> > TIA
> >> > Jared
> >> >
> >