Search code examples
delphidelphi-7

How to remove the title bar from a form


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:

enter image description here


Solution

  • 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;