Re: How to hide title bar of the MDI Child form?

From: Kurt Barthelmess (kbarthelmess_at_compuserve.com)
Date: 11/11/03


Date: Tue, 11 Nov 2003 11:04:00 GMT


"Thomas Wang" <thomas23@126.com> wrote:

>Subject: How to hide title bar of the MDI Child form?

The title or caption bar is part of the form, so hiding it woulld mean
hiding the entire window. That's not possible for MDI children but
it's also probably not what you want.

I think what you are asking is if it is possible to have an MDI child
without a caption area including the min/max/close buttons at the top
right and the system menu at the top left. You may be able to do this
in a couple of ways:

1) Creating the child with the appropriate changes to the Create
structure

2) Letting the window be created normally, but taking over the
painting of the non-client area.

The first solution is probably the least likely to work. The Windows
implementation of MDI makes certain assumptions about MDI children.
Trying to sneak past Microsoft's idea of how MDI should work can be
difficult. The second is probably the easiest to implement. Watch for
the various WM_NCxxxx messages that relate to mouse buttons, painting,
etc.

Remember that when an MDI child is maximized, it's caption bar is
merged with that of the parent. I don't know how you want to handle
that, if at all.

Also note that removing the caption bar means the user will have a
difficult time moving, sizing and closing the child. I would be very
careful about providing alternate means for these functions or your
customers will get very confused about what is going on. Actually,
they will be anyhow<g>.

Good luck.

Kurt



Relevant Pages

  • Re: MDI app: Cant get window focus of modeless child dialog window
    ... I ended up just creating a basic MDI child window, ... > contents - I have an edit control and a few buttons in there. ...
    (microsoft.public.win32.programmer.ui)
  • Re: MDI child frame - incorrectly WM_NCLBUTTONDBLCLK
    ... > activates the MDI child window. ... The problem is that you don't know if OnActivateView has ...
    (microsoft.public.vc.mfc)
  • Re: Anybody did some magic with Windows MDI in VCL?
    ... Child would appear as a separate application with the MDI ... document is its own window, it is not a child of a MainForm. ... the application icon and the MDI Child title. ... you need to override the form's CreateParamsmethod. ...
    (borland.public.delphi.thirdpartytools.general)
  • Re: How to host a .NET MDI Child Window inside a VB6 MDI Application
    ... > I've tried using the SetParent API - this half works as in the MDI child ... > window is constrained by the MDI parent, however the window does not draw ... in VB6 instead of using a .NET form. ...
    (microsoft.public.dotnet.framework.windowsforms)
  • Re: maximize the MDI child
    ... 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. ...
    (microsoft.public.dotnet.languages.csharp)