TableLayoutPanel.CellBorderStyle Właściwość

Definicja

Pobiera lub ustawia styl obramowań komórek.

public:
 property System::Windows::Forms::TableLayoutPanelCellBorderStyle CellBorderStyle { System::Windows::Forms::TableLayoutPanelCellBorderStyle get(); void set(System::Windows::Forms::TableLayoutPanelCellBorderStyle value); };
public System.Windows.Forms.TableLayoutPanelCellBorderStyle CellBorderStyle { get; set; }
member this.CellBorderStyle : System.Windows.Forms.TableLayoutPanelCellBorderStyle with get, set
Public Property CellBorderStyle As TableLayoutPanelCellBorderStyle

Wartość właściwości

TableLayoutPanelCellBorderStyle

TableLayoutPanelCellBorderStyle Jedna z wartości opisujących styl wszystkich obramowań komórek w tabeli. Wartość domyślna to None.

Wyjątki

Tylko platforma .NET 6 i nowsze wersje: wartość właściwości jest nieprawidłowa dla typu wyliczenia.

Przykłady

Poniższy przykład kodu ustawia wartość BorderStyle właściwości w zależności od wybranego RadioButtonelementu .

private void borderStyleOutsetRadioBtn_CheckedChanged(
    System.Object sender, 
    System.EventArgs e)
{
    this.TableLayoutPanel1.CellBorderStyle = 
        TableLayoutPanelCellBorderStyle.Outset;
}

private void borderStyleNoneRadioBtn_CheckedChanged(
    System.Object sender, 
    System.EventArgs e)
{
    this.TableLayoutPanel1.CellBorderStyle = 
        TableLayoutPanelCellBorderStyle.None;
}

private void borderStyleInsetRadioBtn_CheckedChanged(
    System.Object sender, 
    System.EventArgs e)
{
    this.TableLayoutPanel1.CellBorderStyle = 
        TableLayoutPanelCellBorderStyle.Inset;
}
Private Sub borderStyleOutsetRadioBtn_CheckedChanged( _
ByVal sender As System.Object, _
ByVal e As System.EventArgs) _
Handles borderStyleOutsetRadioBtn.CheckedChanged

    Me.TableLayoutPanel1.CellBorderStyle = TableLayoutPanelCellBorderStyle.Outset

End Sub

Private Sub borderStyleNoneRadioBtn_CheckedChanged( _
ByVal sender As System.Object, _
ByVal e As System.EventArgs) _
Handles borderStyleNoneRadioBtn.CheckedChanged

    Me.TableLayoutPanel1.CellBorderStyle = TableLayoutPanelCellBorderStyle.None

End Sub

Private Sub borderStyleInsetRadioBtn_CheckedChanged( _
ByVal sender As System.Object, _
ByVal e As System.EventArgs) _
Handles borderStyleInsetRadioBtn.CheckedChanged

    Me.TableLayoutPanel1.CellBorderStyle = TableLayoutPanelCellBorderStyle.Inset

End Sub

Uwagi

Ustawienie tej wartości powoduje ponowne rysowanie się na panelu i jego zawartości.

Dotyczy

Zobacz też