DataGridViewCell::BorderWidths Method (DataGridViewAdvancedBorderStyle^)
Returns a Rectangle that represents the widths of all the cell margins.
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
protected: virtual Rectangle BorderWidths( DataGridViewAdvancedBorderStyle^ advancedBorderStyle )
Parameters
- advancedBorderStyle
-
Type:
System.Windows.Forms::DataGridViewAdvancedBorderStyle^
A DataGridViewAdvancedBorderStyle that the margins are to be calculated for.
Return Value
Type: System.Drawing::RectangleA Rectangle that represents the widths of all the cell margins.
The default width of the cell border is one pixel. Use the following DataGridViewAdvancedCellBorderStyle values to modify the width of the border:
The None value denotes a width of 0 pixels.
The OutsetDouble or InsetDouble values increase the default width by 1 pixel.
In addition, if the DividerHeight property is set for the cell's owning row, the rectangle's height is increased by the value of DividerHeight. If the DividerWidth property is set for the cell's owning column, the rectangle's width will be increased by the value of DividerWidth.
The following code example demonstrates how to use the BorderWidths method of the DataGridViewCell class to determine the available drawing area in a cell. This code example is part of a larger example provided in How to: Disable Buttons in a Button Column in the Windows Forms DataGridView Control.
Available since 2.0