Export (0) Print
Expand All

Panel.BorderStyle Property

Indicates the border style for the control.

[Visual Basic]
Public Property BorderStyle As BorderStyle
[C#]
public BorderStyle BorderStyle {get; set;}
[C++]
public: __property BorderStyle get_BorderStyle();
public: __property void set_BorderStyle(BorderStyle);
[JScript]
public function get BorderStyle() : BorderStyle;
public function set BorderStyle(BorderStyle);

Property Value

One of the BorderStyle values. The default is BorderStyle.None.

Remarks

By default, the Panel control is displayed without a border. You can use this property to distinguish the boundaries of the Panel control from other areas on the form.

Example

[Visual Basic, C#, C++] The following example creates a Panel control with a three-dimensional border.

[Visual Basic] 
Public Sub CreateMyPanel()
    Dim panel1 As New Panel()
       
    ' Initialize the Panel control.
    panel1.Location = New Point(56, 72)
    panel1.Size = New Size(264, 152)
    ' Set the Borderstyle for the Panel to three-dimensional.
    panel1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D
End Sub


[C#] 
public void CreateMyPanel()
{
   Panel panel1 = new Panel();
   
   // Initialize the Panel control.
   panel1.Location = new Point(56,72);
   panel1.Size = new Size(264, 152);
   // Set the Borderstyle for the Panel to three-dimensional.
   panel1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
}


[C++] 
public:
 void CreateMyPanel()
 {
    Panel* panel1 = new Panel();
    
    // Initialize the Panel control.
    panel1->Location = Point(56,72);
    panel1->Size = System::Drawing::Size(264, 152);
    // Set the Borderstyle for the Panel to three-dimensional.
    panel1->BorderStyle = System::Windows::Forms::BorderStyle::Fixed3D;
 }
 

[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button Language Filter in the upper-left corner of the page.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also

Panel Class | Panel Members | System.Windows.Forms Namespace

Show:
© 2014 Microsoft