How to make a Form's width less than 123

Hi experts, I need to create another form in my project that I only show modally. This form contains only a tall, narrow TMemo and a small OK button directly underneath that. The widths of the TMemo and OK button are about only 50 pixels each. I'd like to make the width of this form also about 50 or 51 pixels too (and not show any border icons). I disabled all the border icons and tried to design the form to be this narrow, but it seems it won't go any narrower than 123. Is there some setting in the tForm properties I'm missing?


P.S: I'm using Delphi 7
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Hi Shawn,
At design time, that's the minimum that you can set, but you can change the width at the form OnActivate, OnShow or OnCreate but the BorderStyle must be bsSizeToolWin, bsToolWindow, bsNone or bsDialog.

Each has it's own characteristics:
bsNone: No caption bar, no form frame and no resize.
bsDialog, bsToolWindow: Close Button (x at top right corner), form frame and no resize.
bsSizeToolWin: same as bsToolWindow but with resize ability.

To hide the buttons set all biXXX under BorderIcons to False, to have caption and frame but no buttons (Form frame depends on the BorderStyle).

procedure TForm1.FormCreate(Sender: TObject);
  BorderStyle:= bsDialog;  // have caption and form frame
  BorderIcons:= []; // no buttons
  width:= 50;

Open in new window

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
shawn857Author Commented:
ahhh nice! Thanks Jimy!

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.