Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

Panel.BorderStyle Property

Indicates the border style for the control.

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in system.windows.forms.dll)

Public Property BorderStyle As BorderStyle
Dim instance As Panel
Dim value As BorderStyle

value = instance.BorderStyle

instance.BorderStyle = value
/** @property */
public BorderStyle get_BorderStyle ()

/** @property */
public void set_BorderStyle (BorderStyle value)

public function get BorderStyle () : BorderStyle

public function set BorderStyle (value : BorderStyle)

Property Value

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


The specified value when setting this property is not a valid BorderStyle value.

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.

The following code example creates a Panel control with a three-dimensional border.

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

public void CreateMyPanel()
    Panel panel1 = new Panel();

    // Initialize the Panel control.
    panel1.set_Location(new Point(56, 72));
    panel1.set_Size(new Size(264, 152));

    // Set the Borderstyle for the Panel to three-dimensional.
} //CreateMyPanel

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0, 1.1, 1.0
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

© 2014 Microsoft. All rights reserved.