| To hide the caption bar you need to override on of the default form methods CreateParams (this also exists for other objects). The CreateParams method initializes a window-creation parameter record passed in the Params parameter (ref:Delphi Help). Go to the protected/public section on the form and override the CreateParams method by typing the following: procedure CreateParams(var Params: TCreateParams); override;
Within the unit type the following for the CreateParams method. procedure TForm1.CreateParams(var Params: TCreateParams);
begin
inherited CreateParams (Params);
with Params do
style := (Style or WS_POPUP) and (not WS_DLGFRAME);
end;
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs;
type
TForm1 = class(TForm)
private
{ Private declarations }
procedure CreateParams(var Params: TCreateParams); override;
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.CreateParams(var Params: TCreateParams);
begin
inherited CreatePArams (Params);
with Params do
style := (Style or WS_POPUP) and (not WS_DLGFRAME);
end;
end.
|