• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 146
  • Last Modified:

Form Size

I need to have a form that has no border, spans the width of the screen (regardless of the screen size) but only has a certain height. In other words I want to maximize a form with no border but limit the height of the form. Also, the form needs to say at the top of the screen.

1 Solution

Here are the steps. You can do most of the steps inside the IDE during design time.

To make a borderless form:
Form1.BorderStyle := bsNone;

To set the width to span the whole screen width:
OnCreate or OnShow event of the Form,

Form1.Width := Screen.Width;

Then just set the height like so:
Form1.Height := 10; //or whatever else you want ;-)

To make the form stay on top:
Form1.FormStyle := fsStayOnTop;

Now since the form is borderless the user can't resize the form but you can also set the Form's constraints property options MinHeight and MinWidth, that way the form will never be smaller than the number you specify.

Hope this helps!

mdlittleAuthor Commented:
Btecho, thanks. I am still looking into your other answer from my other question.

Featured Post

Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now