DataGridViewCell.Size 属性

定义

获取单元格的大小。Gets the size of the cell.

public:
 property System::Drawing::Size Size { System::Drawing::Size get(); };
[System.ComponentModel.Browsable(false)]
public System.Drawing.Size Size { get; }
[<System.ComponentModel.Browsable(false)>]
member this.Size : System.Drawing.Size
Public ReadOnly Property Size As Size

属性值

Size

已设置为所属行高度和所属列宽度的 SizeA Size set to the owning row's height and the owning column's width.

属性

例外

包含该单元格的行是共享行。The row containing the cell is a shared row.

-或--or-

该单元格是列标题单元格。The cell is a column header cell.

注解

如果该单元格未与控件关联 DataGridView ,则 Size 属性将返回一个 Size 宽度和高度均为-1 的。If the cell is not associated with a DataGridView control, the Size property returns a Size with a width and height of -1.

适用于

另请参阅