RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TPanel.BorderWidth Property

Specifies the distance, in pixels, between the outer and inner bevels.

Pascal
property BorderWidth: TBorderWidth;
C++
__property TBorderWidth BorderWidth;__property TBorderWidth BorderWidth;

Use BorderWidth to specify how wide the border around the panel should be. A value of 0 (zero) means no border should appear. 

The border of a panel is the area between the outer and inner bevels. It is visible only if the inner bevel is raised or lowered, but affects the inset of the caption within the panel even if BevelInner is bvNone. If the Alignment property is not taCenter, the Caption will be aligned to the inner edge of the border. This edge is BorderWidth pixels in from the outer bevel if BevelInner is bvNone. It is the inner edge of the inner bevel otherwise. 

Do not confuse the border of the panel with line drawn around the panel itself. The line around the panel is specified by the BorderStyle property.  

C++ Examples: 

 

/*
This example uses a panel component and a button named 
CreateStatusLine on a form. The code moves the panel to the 
bottom of the form when the user clicks the button and gives
the panel the appearance of a status line by changing the 
value of the BevelInner, BevelOuter, BevelWidth, and 
BorderWidth properties.
*/
void __fastcall TForm1::CreateStatusLineClick(TObject *Sender)
{
  Panel1->Align = alBottom;
  Panel1->BevelInner = bvLowered;
  Panel1->BevelOuter = bvRaised;
  Panel1->BorderWidth = 1;
  Panel1->BevelWidth = 1;
}

 

Delphi Examples: 

{
This example uses a panel component and a button named 
CreateStatusLine on a form. The code moves the panel to the 
bottom of the form when the user clicks the button and gives
the panel the appearance of a status line by changing the 
value of the BevelInner, BevelOuter, BevelWidth, and 
BorderWidth properties.
} 
procedure TForm1.CreateStatusLineClick(Sender: TObject);
begin
  with Panel1 do
  begin
    Align := alBottom;
    BevelInner := bvLowered;
    BevelOuter := bvRaised;
    BorderWidth := 1;
    BevelWidth := 1;
  end;
end;

 

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!