DataGridView.GetColumnDisplayRectangle(Int32, Boolean) 方法

定义

返回表示某一列(由列索引确定)的显示区域的矩形。Returns the rectangle that represents the display area for a column, as determined by the column index.

public:
 System::Drawing::Rectangle GetColumnDisplayRectangle(int columnIndex, bool cutOverflow);
public System.Drawing.Rectangle GetColumnDisplayRectangle (int columnIndex, bool cutOverflow);
member this.GetColumnDisplayRectangle : int * bool -> System.Drawing.Rectangle
Public Function GetColumnDisplayRectangle (columnIndex As Integer, cutOverflow As Boolean) As Rectangle

参数

columnIndex
Int32

所需单元格的列索引。The column index for the desired cell.

cutOverflow
Boolean

如果要返回 DataGridView 界限内可见的列矩形,为 true;如果要返回整个列矩形,为 falsetrue to return the column rectangle visible in the DataGridView bounds; false to return the entire column rectangle.

返回

表示列显示矩形的 RectangleThe Rectangle that represents the display rectangle of the column.

异常

columnIndex 不在 0 到列数减 1 的有效范围内。columnIndex is not in the valid range of 0 to the number of columns minus 1.

适用于

另请参阅