DataGridViewHeaderCell.Paint 方法

定义

绘制当前的 DataGridViewHeaderCell

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);
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
Protected Overrides Sub Paint (graphics As Graphics, clipBounds As Rectangle, cellBounds As Rectangle, rowIndex As Integer, dataGridViewElementState As DataGridViewElementStates, value As Object, formattedValue As Object, errorText As String, cellStyle As DataGridViewCellStyle, advancedBorderStyle As DataGridViewAdvancedBorderStyle, paintParts As DataGridViewPaintParts)

参数

graphics
Graphics

用于绘制单元格的 Graphics

clipBounds
Rectangle

一个 Rectangle,表示需要重新绘制的 DataGridView 区域。

cellBounds
Rectangle

一个包含所绘制的单元格边界的 Rectangle

rowIndex
Int32

当前所绘制的单元格的行索引。

dataGridViewElementState
DataGridViewElementStates

用于指定单元格状态的 DataGridViewElementStates 值的按位组合。

value
Object

当前所绘制的单元格的数据。

formattedValue
Object

当前所绘制的单元格的格式化数据。

errorText
String

与单元格关联的错误消息。

cellStyle
DataGridViewCellStyle

包含有关单元格的格式和样式信息的 DataGridViewCellStyle

advancedBorderStyle
DataGridViewAdvancedBorderStyle

包含正在绘制的单元格的边框样式的 DataGridViewAdvancedBorderStyle

paintParts
DataGridViewPaintParts

DataGridViewPaintParts 值的按位组合,用于指定需要绘制的单元格部分。

适用于