Panel.BorderStyle 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
表示控制區的邊框風格。
public:
property System::Windows::Forms::BorderStyle BorderStyle { System::Windows::Forms::BorderStyle get(); void set(System::Windows::Forms::BorderStyle value); };
public System.Windows.Forms.BorderStyle BorderStyle { get; set; }
member this.BorderStyle : System.Windows.Forms.BorderStyle with get, set
Public Property BorderStyle As BorderStyle
屬性值
這是其中一項 BorderStyle 價值。 預設值為 BorderStyle.None。
例外狀況
設定此屬性時指定的值並非有效 BorderStyle 值。
範例
以下程式碼範例建立 Panel 一個帶有三維邊界的控制項。
public:
void CreateMyPanel()
{
Panel^ panel1 = gcnew 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;
}
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;
}
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
備註
預設情況下, Panel 控制鍵顯示時沒有邊框。 你可以利用這個特性來區分控制項與表單上其他區域的邊界 Panel 。