Reputation: 143
Does anyone know how to create a Delphi form without a title bar? I have seen some some links/tips but its not exactly what I want and I couldn't do it myself.
This is what I am trying to achieve:
Upvotes: 14
Views: 13966
Reputation: 31
For better border style, you can add the WS_BORDER flag.
Like this:
procedure TForm1.CreateParams(var Params: TCreateParams);
begin
inherited;
Params.Style := Params.Style or WS_BORDER or WS_THICKFRAME;
end;
Note than a soft line is drawn inside the border frame.
Upvotes: 3
Reputation: 108929
First, set BorderStyle
to bsNone
at design-time. Then declare the procedure CreateParams
like so:
type
TForm1 = class(TForm)
private
protected
procedure CreateParams(var Params: TCreateParams); override; // ADD THIS LINE!
{ Private declarations }
public
{ Public declarations }
end;
and implement it like
procedure TForm1.CreateParams(var Params: TCreateParams);
begin
inherited;
Params.Style := Params.Style or WS_THICKFRAME;
end;
Upvotes: 18