Partager via


DataGridViewRow.Paint Méthode

Définition

Peint la ligne actuelle.

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)

Paramètres

graphics
Graphics

Utilisé Graphics pour peindre le DataGridViewRow.

clipBounds
Rectangle

Qui Rectangle représente la zone de celle DataGridView qui doit être peinte.

rowBounds
Rectangle

Qui Rectangle contient les limites de la DataGridViewRow peinture.

rowIndex
Int32

Index de ligne de la cellule en cours de peinture.

rowState
DataGridViewElementStates

Combinaison de valeurs au niveau du DataGridViewElementStates bit qui spécifie l’état de la ligne.

isFirstDisplayedRow
Boolean

true pour indiquer si la ligne actuelle est la première ligne affichée dans le DataGridView; sinon, false.

isLastVisibleRow
Boolean

true pour indiquer si la ligne actuelle est la dernière ligne de la DataGridViewVisible propriété définie truesur ; sinon, false.

Exceptions

La ligne n’a pas été ajoutée à un DataGridView contrôle.

- ou -

La ligne se trouve dans un DataGridView contrôle et est une ligne partagée.

La ligne se trouve dans un DataGridView contrôle et rowIndex est inférieure à zéro ou supérieure au nombre de lignes du contrôle moins un.

Remarques

Le DataGridView contrôle appelle cette méthode pour peindre la ligne.

L’appel de cette méthode déclenche l’événement DataGridView.RowPrePaint . Si un gestionnaire pour l’événement ne définit pas la HandledEventArgs.Handled propriété true, cette méthode appelle également les PaintHeader méthodes et PaintCells déclenche l’événement DataGridView.RowPostPaint .

S’applique à

Voir aussi