DataGridView.GetColumnDisplayRectangle(Int32, Boolean) 方法

定义

返回表示某一列(由列索引确定)的显示区域的矩形。

C#
public System.Drawing.Rectangle GetColumnDisplayRectangle(int columnIndex, bool cutOverflow);

参数

columnIndex
Int32

所需单元格的列索引。

cutOverflow
Boolean

如果要返回 DataGridView 界限内可见的列矩形,为 true;如果要返回整个列矩形,为 false

返回

表示列显示矩形的 Rectangle

例外

columnIndex 不在 0 到列数减 1 的有效范围内。

适用于

产品 版本
.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, 10

另请参阅