共用方式為


TableLayoutPanel.CellBorderStyle 屬性

定義

取得或設定儲存格框線的樣式。

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

屬性值

其中一個 TableLayoutPanelCellBorderStyle 值,描述資料表中所有儲存格框線的樣式。 預設為 None

例外狀況

僅限 .NET 6 和更新版本:屬性值對列舉類型無效。

範例

下列程式碼範例會根據選取 RadioButtonBorderStyle 來設定 屬性的值。

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

備註

設定此值會導致面板重新繪製本身及其內容。

適用於

另請參閱