Recent

Author Topic: [SOLVED] TPageControl doesn't cover Form from side to side  (Read 348 times)

Slyde

  • Jr. Member
  • **
  • Posts: 92
[SOLVED] TPageControl doesn't cover Form from side to side
« on: September 18, 2022, 07:12:00 pm »
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?

« Last Edit: September 18, 2022, 07:42:46 pm by Slyde »

wp

  • Hero Member
  • *****
  • Posts: 10288
Re: TPageControl doesn't cover Form from side to side
« Reply #1 on: September 18, 2022, 07:24:00 pm »
Is there a way to get rid of this space?
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

  • Jr. Member
  • **
  • Posts: 92
Re: TPageControl doesn't cover Form from side to side
« Reply #2 on: September 18, 2022, 07:26:50 pm »
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!
« Last Edit: September 18, 2022, 07:34:37 pm by Slyde »

Nicole

  • Sr. Member
  • ****
  • Posts: 496
Re: [SOLVED] TPageControl doesn't cover Form from side to side
« Reply #3 on: September 19, 2022, 08:23:26 pm »
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

  • Sr. Member
  • ****
  • Posts: 414
Re: TPageControl doesn't cover Form from side to side
« Reply #4 on: September 19, 2022, 09:12:05 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.

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 :-)

Arioch

  • Sr. Member
  • ****
  • Posts: 414
Re: [SOLVED] TPageControl doesn't cover Form from side to side
« Reply #5 on: September 19, 2022, 09:13:24 pm »
In Win 11 we have round corners.

When i was running Windows 2000 - every program had there different style and shape of windows, not one corner fits all :-)

( Stardock WindowBlinds, Windows XP bought a part of it )

wp

  • Hero Member
  • *****
  • Posts: 10288
Re: TPageControl doesn't cover Form from side to side
« Reply #6 on: September 19, 2022, 10:54:28 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.
Not sure 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.
Absolutely. No problems with the TNoteBook in Lazarus (I wrote many projects with it), unlike Delphi where handling with it is very difficult (just tested with v10.4). You only must know that the easiest way to switch pages (they don't have tabs!) is in the object tree of the object inspector.

 

TinyPortal © 2005-2018