We know TPanel Control has methods to help manage the placement of child controls embedded in the panel. You can also use panels to group controls together, similar to the way you can use a group box. How about having a collection of cards or pages which help to manage the child controls and display only one of them at a time similar to a TabControl? Yes, Delphi provides an excellent VCL component TCardPanel. This post guide you to get TCardPanel sample Project from the GetIt Package manager.
Overview of TCardPanel:
TCardPanel allows you to display a collection of cards or pages (TPanel controls) that can be displayed one at a time. The control displays the active card and its content and you can write code to switch to any other card or use the integrated mechanism to let a user move among cards sequentially with a swipe gesture. A Card Panel hosts multiple subpanels displaying only one of them, similar to a TabControl, but it has no specific UI indicating the various panels.
How to install TCardPanel Demo: You can easily install this Sample Project from GetIt Package Manager. The steps are as follows.
- Navigate In RAD Studio IDE->Tools->GetIt Package Manager->select Sample Projects in Categories-> Card Panel Demo(Delphi) 1.0 by Embercadero Technologies and click Install Button.
- Read the license and Click Agree All. An Information dialog saying ‘Requires a restart of RAD studio at the end of the process. Do you want to proceed? Click yes and continue.
- It will download the plugin and installs it. Once installed Click Restart now.
- Upon installation completion, it opens the sample project CardPanel. You can compile, and run the application. The source code is located in the location C:UsersPublicDocumentsEmbarcaderoStudio21.0SamplesObject PascalVCLCardPanel
- This Sample app contains a TCardPanel on the form with 5 cards placed with each contains an image component. On clicking the button Previous and Next the respective cards were navigated. for more details check this Docwiki. Check the TCardPanel Demo output here,
Be sure to check out all the available sample applications here!