DataGridViewCell.GetErrorIconBounds(Graphics, DataGridViewCellStyle, Int32) DataGridViewCell.GetErrorIconBounds(Graphics, DataGridViewCellStyle, Int32) DataGridViewCell.GetErrorIconBounds(Graphics, DataGridViewCellStyle, Int32) Method

定义

如果显示了单元格的错误图标,则返回环绕该图标的边框。Returns the bounding rectangle that encloses the cell's error icon, if one is displayed.

protected:
 virtual System::Drawing::Rectangle GetErrorIconBounds(System::Drawing::Graphics ^ graphics, System::Windows::Forms::DataGridViewCellStyle ^ cellStyle, int rowIndex);
protected virtual System.Drawing.Rectangle GetErrorIconBounds (System.Drawing.Graphics graphics, System.Windows.Forms.DataGridViewCellStyle cellStyle, int rowIndex);
abstract member GetErrorIconBounds : System.Drawing.Graphics * System.Windows.Forms.DataGridViewCellStyle * int -> System.Drawing.Rectangle
override this.GetErrorIconBounds : System.Drawing.Graphics * System.Windows.Forms.DataGridViewCellStyle * int -> System.Drawing.Rectangle

参数

graphics
Graphics Graphics Graphics

单元格的图形上下文。The graphics context for the cell.

cellStyle
DataGridViewCellStyle DataGridViewCellStyle DataGridViewCellStyle

要对单元格应用的 DataGridViewCellStyleThe DataGridViewCellStyle to be applied to the cell.

rowIndex
Int32 Int32 Int32

该单元格的父行索引。The index of the cell's parent row.

返回

如果显示了单元格的错误图标,则为包围该图标的 Rectangle;否则为 EmptyThe Rectangle that bounds the cell's error icon, if one is displayed; otherwise, Empty.

注解

调用此方法时,动态计算的单元格的错误图标区域的大小。The size of the cell's error icon area is computed dynamically when this method is called. 基类实现始终返回Rectangle.EmptyThe base class implementation always returns Rectangle.Empty.

当在内部调用此方法ErrorIconBounds属性为只读。This method is called internally when the ErrorIconBounds property is read.

适用于

另请参阅