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の領域を表すDataGridView

rowBounds
Rectangle

描画中のRectangleの境界を含むDataGridViewRow

rowIndex
Int32

描画中のセルの行インデックス。

rowState
DataGridViewElementStates

行の状態を指定する DataGridViewElementStates 値のビットごとの組み合わせ。

isFirstDisplayedRow
Boolean

現在の行が に表示される最初の行かどうかを示す場合は &。それ以外の場合は

isLastVisibleRow
Boolean

true現在の行が、DataGridView プロパティが Visible に設定されているtrueの最後の行であるかどうかを示す場合は >。それ以外の場合はfalse

例外

行が DataGridView コントロールに追加されていません。

-又は-

行は DataGridView コントロールにあり、共有行です。

行が DataGridView コントロール内にあり、 rowIndex が 0 未満か、コントロール内の行数から 1 を引いた数より大きい値です。

注釈

DataGridView コントロールは、このメソッドを呼び出して行を描画します。

このメソッドを呼び出すと、 DataGridView.RowPrePaint イベントが発生します。 イベントのハンドラーが HandledEventArgs.Handled プロパティを true に設定していない場合、このメソッドは PaintHeader メソッドと PaintCells メソッドも呼び出し、 DataGridView.RowPostPaint イベントを発生させます。

適用対象

こちらもご覧ください