Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make TForm shows scrollbars when BorderStyle=bsNone?

When their BorderStyle is set to bsNone, TForms usually won't show scrollbars even if the AutoScroll is True and some children controls positions exceed ClientWidth/ClientHeight values.

So, is there any method/hack to "force" TForm to show scrollbars (when needed) even if its BorderStyle is set to bsNone?

like image 830
Luthfi Avatar asked Dec 03 '25 22:12

Luthfi


1 Answers

Put a TScrollBox on the form, make it Align=Client, put all your controls on the scroll box.

I always use a TScrollBox because it's very flexible. You can add a top-aligned panel to the form (outside the scroll-box) and you've got a non-scrolled area. Having the whole form scroll is not always helpful and it almost never looks good.

like image 84
Cosmin Prund Avatar answered Dec 06 '25 13:12

Cosmin Prund



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!