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:
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:
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;
Params.Style or WS_BORDER or WS_THICKFRAME
also does that). Still resizable thought. –
Oubre Set BorderStyle
to bsNone
in Object Inspector
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.
© 2022 - 2024 — McMap. All rights reserved.