Tpanel is located on the standard component panel and is also a common container control. One advantage of a panel is that the components placed on the panel are called a part of the panel, so they move together with the Panel. This is useful in the design phase.
Most of the functions of the Panel component are its align attribute. For example, if you want to display the title at the top of the form, let us assume that you want it to be in the center. No matter how you set the window size, you only need to set the align attribute to altop and the alignment attribute to tacenter, in this way, the title is always in the center, which is so simple.
The Panel has a variety of appearances, which are changed through the bevelinner, bevelouter, borderstyle, and borderwidth attributes.
Main Properties of the tpanel Control
| Attribute |
Description |
| Alignment |
Title location, including taleftjustify (left), tacenter (center), and tarightjustify (right) |
| Bevelinner |
Defines the inclined surface style in the panel, including bvnone (no inclined surface), bvlowered (concave), bvraised (convex), bvspace (convex, the same as bvraised ). |
| Bevelouter |
Defines the style of the plane outside the panel, which is the same as the bevelinner option. |
| Bevelwidth |
Defines the width of the inner and inner Slopes |
| Borderstyle |
Defines the border style, which can be bsnone (no border, default value) or bssingle (fine border ). |
| Borderwidth |
Specify the Border width, which can be any integer. |
| Fullrepaint |
Specifies the re-painting method of the Panel when the Panel is adjusted to an hour. If the value is true, the entire panel, including the inclined border, is re-painted. Otherwise, only the part inside the inclined border is re-painted. |
| Locked |
When panel is used as the toolbar of the OLE application, this attribute is used to specify whether the Panel is replaced by the toolbar of OLE server. If it is set to true, it is not replaced. |
Panel components are so diverse that it takes some time to discover all possible applications.
Shows examples of panel styles of Different Types
The above code passes the test in Delphi7. Download the sample code:Different form of panel .rar