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

定義

繪製目前的 DataGridViewHeaderCellPaints the current 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);
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

Rectangle,其中包含所繪製之儲存格的界限。A 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.

適用於