TableLayoutPanel.CellBorderStyle Property

Definition

Gets or sets the style of the cell borders.

public System.Windows.Forms.TableLayoutPanelCellBorderStyle CellBorderStyle { get; set; }

Property Value

One of the TableLayoutPanelCellBorderStyle values describing the style of all the cell borders in the table. The default is None.

Exceptions

.NET 6 and later versions only: The property value is not valid for the enumeration type.

Examples

The following code example sets the value of the BorderStyle property depending on the selected RadioButton.

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;
}

Remarks

Setting this value causes the panel to redraw itself and its contents.

Applies to

Өнім Нұсқалар
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9

See also