SolveErrors
Delphi Programming

Keep forward MDI Child form over other controls.

14 views

Ahmadi wrote:

> Hi
> I have a MDI Form and some MDI Childs and one panel on the MDI
> Form(background panel), all of my MDI Childs are under the panel !
> I want my MDI Child Forms move forward and over all of my MDI Form
> controls, How can i do that?


MDI child forms cannot be put onto a container like a panel, they are
hosted by the MDI client window, which is a special API-level window
that fills the client area of a MDI main form. This is a requirement of
the Windows MDI framework.

You can have additional TWincontrol descendents (like panels or
toolbars) on a MDI main form as long as their Align property is set to
alLeft, alTop, alBottom, or alRight. The MDI client window will adjust
to take up the remaining client area (you can think of it as aligned
with Align = alClient).

If you want a background image under the child forms you can put a
client-aligned TGraphicControl descendent (like TImage) on the main
form. Since TGraphicControls have no window handle they do not
interfere with the MDI child forms and the VCL contains code to draw
the graphic controls onto the MDI client window. Note that this is not
the case in older Delphi versions, though. I don't remember when it was
introduced (D5 or later perhaps). If you use an older version it
requires some code to draw stuff on the MDI client window. See
http://tinyurl.com/5ggq6l for an example.

--
Peter Below (TeamB)
Don't be a vampire (http://slash7.com/pages/vampires),
use the newsgroup archives :
http://www.tamaracka.com/search.htm
http://groups.google.com

More Delphi Programming fixes

"Enable Runtime Themes" blocks running from external programsAfter embedding a form into another form i have focus problem on my first form controls![Delphi 2007] How can i set that delphi start form # from 1(after starting a new VCL project)?Using D6, deploy app with runtime packages..package collections editor?Delphi2007 link with static C-libraryClass Completion Of Object Delphi 2007 bug