Delphi MDI Application and the titlebar of the MDI Children

Question :

Delphi MDI Application and the titlebar of the MDI Children,

Answer :

I’ve got an MDI application written in Delphi 2006 which runs XP with the default theme.

Is there a way of controlling the appearance of the MDI Children to avoid the large XP-style title bar on each window?

I’ve tried setting the BorderStyle of the MDIChildren to bsSizeToolWin but they are still rendered as normal Forms.

,

All your need – overload procedure CreateWindowHandle, like this:

unit CHILDWIN;  interface  uses Windows, Classes, Graphics, Forms, Controls, StdCtrls;    type    TMDIChild = class(TForm)    private      { Private declarations }    public      { Public declarations }      procedure CreateWindowHandle(const Params: TCreateParams); override;    end;    implementation    {$R *.dfm}  procedure TMDIChild.CreateWindowHandle(const Params: TCreateParams);  begin    inherited CreateWindowHandle(Params);    SetWindowLong(Handle, GWL_EXSTYLE, WS_EX_TOOLWINDOW);  end;  end.  

That’s the answer Delphi MDI Application and the titlebar of the MDI Children, Hope this helps those looking for an answer. Then we suggest to do a search for the next question and find the answer only on our site.

Read More  Code crash in MS Visual Studio 2005 in RELEASE configuration

Disclaimer :

The answers provided above are only to be used to guide the learning process. The questions above are open-ended questions, meaning that many answers are not fixed as above. I hope this article can be useful, Thank you