DataGridViewRow.PaintCells 方法

定義

繪製目前資料列中的儲存格。

protected public:
 virtual void PaintCells(System::Drawing::Graphics ^ graphics, System::Drawing::Rectangle clipBounds, System::Drawing::Rectangle rowBounds, int rowIndex, System::Windows::Forms::DataGridViewElementStates rowState, bool isFirstDisplayedRow, bool isLastVisibleRow, System::Windows::Forms::DataGridViewPaintParts paintParts);
protected internal virtual void PaintCells (System.Drawing.Graphics graphics, System.Drawing.Rectangle clipBounds, System.Drawing.Rectangle rowBounds, int rowIndex, System.Windows.Forms.DataGridViewElementStates rowState, bool isFirstDisplayedRow, bool isLastVisibleRow, System.Windows.Forms.DataGridViewPaintParts paintParts);
abstract member PaintCells : System.Drawing.Graphics * System.Drawing.Rectangle * System.Drawing.Rectangle * int * System.Windows.Forms.DataGridViewElementStates * bool * bool * System.Windows.Forms.DataGridViewPaintParts -> unit
override this.PaintCells : System.Drawing.Graphics * System.Drawing.Rectangle * System.Drawing.Rectangle * int * System.Windows.Forms.DataGridViewElementStates * bool * bool * System.Windows.Forms.DataGridViewPaintParts -> unit
Protected Friend Overridable Sub PaintCells (graphics As Graphics, clipBounds As Rectangle, rowBounds As Rectangle, rowIndex As Integer, rowState As DataGridViewElementStates, isFirstDisplayedRow As Boolean, isLastVisibleRow As Boolean, paintParts As DataGridViewPaintParts)

參數

graphics
Graphics

用來繪製 DataGridViewRowGraphics

clipBounds
Rectangle

Rectangle,表示需要繪製的 DataGridView 區域。

rowBounds
Rectangle

Rectangle,包含要繪製 DataGridViewRow 的界限。

rowIndex
Int32

正在繪製的儲存格資料列索引。

rowState
DataGridViewElementStates

DataGridViewElementStates 值的位元組合,指定資料列的狀態。

isFirstDisplayedRow
Boolean

若要指出目前資料列是否為 DataGridView 中所顯示的第一個資料列,則為 true,否則為 false

isLastVisibleRow
Boolean

true 表示目前的資料列是否為將 DataGridView 屬性設為 trueVisible 中的最後一個資料列,否則為 false

paintParts
DataGridViewPaintParts

DataGridViewPaintParts 值的位元組合,指出要繪製的儲存格。

例外狀況

資料列未加入至 DataGridView 控制項。

paintParts 不是 DataGridViewPaintParts 值的有效位元組合。

備註

控制項 DataGridView 會呼叫這個方法,以繪製資料列中的儲存格,但事件處理常式 DataGridView.RowPrePaint 會將 屬性設定 HandledEventArgs.Handledtrue 時。 如需詳細資訊,請參閱Paint

適用於

另請參閱