DataGridViewColumnHeaderCell.Paint(Graphics, Rectangle, Rectangle, Int32, DataGridViewElementStates, Object, Object, String, DataGridViewCellStyle, DataGridViewAdvancedBorderStyle, DataGridViewPaintParts) DataGridViewColumnHeaderCell.Paint(Graphics, Rectangle, Rectangle, Int32, DataGridViewElementStates, Object, Object, String, DataGridViewCellStyle, DataGridViewAdvancedBorderStyle, DataGridViewPaintParts) DataGridViewColumnHeaderCell.Paint(Graphics, Rectangle, Rectangle, Int32, DataGridViewElementStates, Object, Object, String, DataGridViewCellStyle, DataGridViewAdvancedBorderStyle, DataGridViewPaintParts) Method

定义

绘制当前的 DataGridViewColumnHeaderCellPaints the current DataGridViewColumnHeaderCell.

protected:
 override void Paint(System::Drawing::Graphics ^ graphics, System::Drawing::Rectangle clipBounds, System::Drawing::Rectangle cellBounds, int rowIndex, System::Windows::Forms::DataGridViewElementStates dataGridViewElementState, System::Object ^ value, System::Object ^ formattedValue, System::String ^ errorText, System::Windows::Forms::DataGridViewCellStyle ^ cellStyle, System::Windows::Forms::DataGridViewAdvancedBorderStyle ^ advancedBorderStyle, System::Windows::Forms::DataGridViewPaintParts paintParts);
protected override void Paint (System.Drawing.Graphics graphics, System.Drawing.Rectangle clipBounds, System.Drawing.Rectangle cellBounds, int rowIndex, System.Windows.Forms.DataGridViewElementStates dataGridViewElementState, object value, object formattedValue, string errorText, System.Windows.Forms.DataGridViewCellStyle cellStyle, System.Windows.Forms.DataGridViewAdvancedBorderStyle advancedBorderStyle, System.Windows.Forms.DataGridViewPaintParts paintParts);
override this.Paint : System.Drawing.Graphics * System.Drawing.Rectangle * System.Drawing.Rectangle * int * System.Windows.Forms.DataGridViewElementStates * obj * obj * string * System.Windows.Forms.DataGridViewCellStyle * System.Windows.Forms.DataGridViewAdvancedBorderStyle * System.Windows.Forms.DataGridViewPaintParts -> unit

参数

graphics
Graphics Graphics Graphics

用于绘制单元格的 GraphicsThe Graphics used to paint the cell.

clipBounds
Rectangle Rectangle Rectangle

Rectangle,它表示需要重新绘制的 DataGridView 区域。A Rectangle that represents the area of the DataGridView that needs to be repainted.

cellBounds
Rectangle Rectangle Rectangle

一个包含所绘制的单元格边界的 RectangleA Rectangle that contains the bounds of the cell that is being painted.

rowIndex
Int32 Int32 Int32

当前所绘制的单元格的行索引。The row index of the cell that is being painted.

dataGridViewElementState
DataGridViewElementStates DataGridViewElementStates DataGridViewElementStates

DataGridViewElementStates 值的按位组合,用于指定单元格的状态。A bitwise combination of DataGridViewElementStates values that specifies the state of the cell.

value
Object Object Object

当前所绘制的单元格的数据。The data of the cell that is being painted.

formattedValue
Object Object Object

当前所绘制的单元格的格式化数据。The formatted data of the cell that is being painted.

errorText
String String String

与单元格关联的错误消息。An error message that is associated with the cell.

cellStyle
DataGridViewCellStyle DataGridViewCellStyle DataGridViewCellStyle

DataGridViewCellStyle,它包含有关单元格的格式设置和样式的信息。A DataGridViewCellStyle that contains formatting and style information about the cell.

advancedBorderStyle
DataGridViewAdvancedBorderStyle DataGridViewAdvancedBorderStyle DataGridViewAdvancedBorderStyle

DataGridViewAdvancedBorderStyle,它包含当前所绘制的单元格的边框样式。A DataGridViewAdvancedBorderStyle that contains border styles for the cell that is being painted.

paintParts
DataGridViewPaintParts DataGridViewPaintParts DataGridViewPaintParts

DataGridViewPaintParts 值的按位组合,用于指定需要绘制的单元格部分。A bitwise combination of the DataGridViewPaintParts values that specifies which parts of the cell need to be painted.

适用于