共用方式為


DataGridViewRow.Paint 方法

定義

把現在這排油漆。

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

參數

graphics
Graphics

他們Graphics過去用來上色。DataGridViewRow

clipBounds
Rectangle

Rectangle A代表需要上色的區域DataGridView

rowBounds
Rectangle

Rectangle A 包含了所繪製的 的界限DataGridViewRow

rowIndex
Int32

就是被繪製的格子的列索引。

rowState
DataGridViewElementStates

一個位元組合 DataGridViewElementStates 的值,指定該列的狀態。

isFirstDisplayedRow
Boolean

true用以表示當前列是否為顯示在 DataGridView;;否則,。 false

isLastVisibleRow
Boolean

true用以表示當前列是否為 中最後一列DataGridView,且性質設定Visibletrue;否則,。 false

例外狀況

該列尚未被 DataGridView 加入控制組。

-或-

該列屬於 DataGridView 控制區,且是共用列。

該列位於控制 DataGridView 列中,且 rowIndex 小於或大於控制列數減一。

備註

控制項呼叫 DataGridView 此方法來繪製該列。

呼叫此方法會提升事件。DataGridView.RowPrePaint 若事件的處理器未將屬性設 HandledEventArgs.Handledtrue,此方法也會呼叫 PaintHeader and PaintCells 方法並引發事件 DataGridView.RowPostPaint

適用於

另請參閱