Remove MDI Child Title Bar

来源:互联网 发布:java统计下载次数 编辑:程序博客网 时间:2024/06/06 01:36

 Remove MDI Child Title Bar


The BorderStyle property of a Delphi form lets you specify the appearance and behavior of the form border.

If you need to hide the title bar of a Multiple Document Interface child form, you might be tempted to set the BorderStyle to bsNone - and make the form not resizable with no visible border line.

However, for an MDI child form, setting the BorderStyle property to bsNone does NOT remove the title bar.
The only way to remove (hide) the border of an MDI child form is by messing with the CreateParams procedure:

 

procedure TMDIChild.CreateParams(var Params: TCreateParams) ;
begin
  inherited;
  Params.style := Params.style and not WS_CAPTION;
end;


Note that removing the caption bar means the user will have a difficult time moving, sizing and closing the child.

原创粉丝点击