Forum > LCL

[SOLVED] TPageControl doesn't cover Form from side to side

(1/2) > >>

Slyde:
It's been a while since I worked with Lazarus.  So when I installed the newest version (2.2.2) and noticed that a PageControl didn't cover the Form from side to side when I set Align = alClient, I was....  Maybe it's just my time to lose my mind.  But I sure don't remember that kind of space showing up when I used PageControl in earlier versions.

Both the Form and PageControl have the same width, yet it clearly shows a line of "space" on either side of the PageControl.  I use PageControl (no tabs) to work as a Qt Stacked Widget, but this is kind of ugly.

Is there a way to get rid of this space?

wp:

--- Quote from: Slyde on September 18, 2022, 07:12:00 pm ---Is there a way to get rid of this space?

--- End quote ---
No. It's Microsofts bad idea for Win 11. Not the only one...

If you don't need the tabs and use the PageControl only to arrange controls in several "layers" it's better to use a TNotebook rather than a Pagecontrol. If you don't know the trick it's a bit awkward to select pages: Use the object tree above the object inspector, it has a node for each page.

Slyde:
Hi wp.

No, this is Linux Mint.  But I'll try out the TNotebook and see how it goes.  Thanks for the tip.

UPDATE:  TNotebook is clean.  I like it!

Nicole:
Not sure, if the idea is not more ugly than the space:

You can try set align = alnone;
and set left to a negative value

PS:
Do not complain about Win 11. Just because you cannot re-use your hardware anymore or 32bit troubles you. In Win 11 we have round corners. I am that glad about those corners, I cannot help myself laughing.
(or I would not be able to, because I will not touch Win 11 too soon)

Arioch:

--- Quote from: wp on September 18, 2022, 07:24:00 pm ---If you don't need the tabs and use the PageControl only to arrange controls in several "layers" it's better to use a TNotebook rather than a Pagecontrol.

--- End quote ---

Not usre about LCL, but in Delphi this legacy component had more and more rendring problems as time went buy. Eventually i had to switch to TPageControl wit hhidden tabs.
But maybe in LCL it is different.

Thanks for head-ups on Win11 - it is insane if true...

Nicole, another trick would be - to place many TPanel on the form, set there Bevels and Borders to None. Then to switch them all to alClient, so they are on top of one another. This is similar to what Notepad does behind the curtails.
Then, how to switch panels? In code - "Panel10.BringToFront", and in IDE there would be BringToFront r-click menu :-)

Navigation

[0] Message Index

[#] Next page

Go to full version