A Shrinkable Panel Demo

Peter Aschbacher
May 20, 2023
Shrinkable Panel

 Why a Shrinkable Panel?

Often we need a Panel with content that is needed only in a specific context - for example to show information about a selected object or to show specific options. For this purpose a Shrinkable Panel is optimal. The following Feature Demo shows how to create a right-aligned Shrinkable Panel that can be minimized to a fixed width where the content is hidden, and then expand it again to its previous width. The previous width is stored in the Panel's Tag property each time the Panel is resized:

  

...and then restored again when the Panel is expanded:

  

Here is a short video that demonstrates the functionality:

 Shrinkable Panel Demo

 Source Code

Here is the Delphi Project source code (created in Delphi 11, no external library needed):


Here is the compiled executable (Digitally signed, compatible with any modern Windows version):