語言

DataGridViewCellPaintingEventArgs.PaintBackground(Rectangle, Boolean) 方法

定義

在指定範圍內繪製該區域的格子背景。

public:
 void PaintBackground(System::Drawing::Rectangle clipBounds, bool cellsPaintSelectionBackground);
public void PaintBackground(System.Drawing.Rectangle clipBounds, bool cellsPaintSelectionBackground);
member this.PaintBackground : System.Drawing.Rectangle * bool -> unit
Public Sub PaintBackground (clipBounds As Rectangle, cellsPaintSelectionBackground As Boolean)

參數

clipBounds
Rectangle

Rectangle A則指定要塗裝的區域DataGridView。

cellsPaintSelectionBackground
Boolean

true將指定界限的背景繪成 的性質顏色;SelectionBackColor將指定界限的背景繪成 的性質顏色InheritedStylefalse。BackColorInheritedStyle

例外狀況

RowIndex 小於 -1 或大於或等於控制列 DataGridView 數。

-或-

ColumnIndex 小於 -1 或大於或等於控制列 DataGridView 數。

適用於

另請參閱