1. Home
  2. Computing & Technology
  3. Delphi Programming

Create a Resizable Form with No Border (FormStyle = bsNone)

By Zarko Gajic, About.com

bsNone + Resizable Delphi form

By default, forms include maximize and minimize buttons, a resizable border, and a menu that provides additional commands to resize the form.

The BorderStyle property of a Delphi Form object can be used to specify the appearance and behavior of the form border.

The bsNone is used when you want to remove the Border and the caption bar from the form - leaving only the content visible. This setting is commonly used when creating a splash screen. One downside to setting the bsNone value for BorderStyle is that such forms cannot be resized!

Resizable Without Border

There may be situations when you want to remove a form's border (and title bar) *but* still leave the option for a user to resize the form. Screen Ruler uses the next trick to display a resizable + no-border window:
//no border BUT resizable
procedure TForm1.CreateParams(var Params: TCreateParams) ;
begin
  BorderStyle := bsNone;

  inherited;

  Params.ExStyle := Params.ExStyle or WS_EX_STATICEDGE;
  Params.Style := Params.Style or WS_SIZEBOX;
end;
The trick is in overriding the CreateParams method!

Delphi tips navigator:
» Animate (Scroll) Application Title on the TaskBar
« TListBox with Radio Buttons

More Delphi Programming Quick Tips
Explore Delphi Programming
About.com Special Features

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

Easy ways to connect two computers for networking purposes. More >

  1. Home
  2. Computing & Technology
  3. Delphi Programming
  4. Coding Delphi Applications
  5. Delphi Tips and Tricks
  6. Delphi 2006 Tips
  7. Create a Resizable Delphi Form with No Border (FormStyle = bsNone)

©2009 About.com, a part of The New York Times Company.

All rights reserved.