Recent

Author Topic: Any way to shrink part of a form?  (Read 1553 times)

egsuh

  • Hero Member
  • *****
  • Posts: 924
Any way to shrink part of a form?
« on: January 07, 2022, 08:55:37 am »
Hi,

Is there any way to shrink part of a form? Imagine that a form is divided in two parts --- upper half and lower half. That is, upper and lower half could be with each panels. And i'd like to minimize lower part, with just a small + button remaining, and the upper part of the form cover the whole part. Then if I press + button again, then the lower half is restored.

I can put spilitter and reduce and expand any part. I'm looking for ways of showing / not showing whole part, not resizing.


GetMem

  • Hero Member
  • *****
  • Posts: 3741
Re: Any way to shrink part of a form?
« Reply #1 on: January 07, 2022, 09:10:13 am »
If I understood correctly:
  - set PanelUpper align to alClient
  - set PanleLower align to alBottom
  - set PanelLower height to 10, so the + button is visible
When you click the plus button, set the height of the lower panel to whatever value you need:
PanelLower.Heigth := 100;
then back to 10 when needed.


speter

  • Sr. Member
  • ****
  • Posts: 267
Re: Any way to shrink part of a form?
« Reply #2 on: January 07, 2022, 10:46:29 am »
For an example, have a look at the attached project. :)

cheers
S.
I climbed mighty mountains, and saw that they were actually tiny foothills. :)

Laz 2.2.0 / FPC 3.2.2 / Windows 11 (64bit)

egsuh

  • Hero Member
  • *****
  • Posts: 924
Re: Any way to shrink part of a form?
« Reply #3 on: January 07, 2022, 12:39:47 pm »
Thank you for the advices.
I could use GroupBox, so that just the caption of GroupBox is shown when shrinked. But I still hope that a genuine such control is available -- in such a way that have a small button on the right upper corner of GroupBox, etc.

 

TinyPortal © 2005-2018