DataGridViewRowPrePaintEventArgs.PaintCellsBackground 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
繪製所指定界限內區域的儲存格背景。
public:
void PaintCellsBackground(System::Drawing::Rectangle clipBounds, bool cellsPaintSelectionBackground);
public void PaintCellsBackground (System.Drawing.Rectangle clipBounds, bool cellsPaintSelectionBackground);
member this.PaintCellsBackground : System.Drawing.Rectangle * bool -> unit
Public Sub PaintCellsBackground (clipBounds As Rectangle, cellsPaintSelectionBackground As Boolean)
參數
- clipBounds
- Rectangle
Rectangle,指定要繪製的 DataGridView 區域。
- cellsPaintSelectionBackground
- Boolean
true
表示以 SelectionBackColor 之 InheritedStyle 屬性的色彩繪製所指定界限的背景;false
則表示要以 BackColor 之 InheritedStyle 屬性的色彩繪製所指定界限的背景。
例外狀況
RowIndex 小於零或大於 DataGridView 控制項的資料列數減一。
備註
當您自行繪製 DataGridViewRow 及其儲存格的內容時, PaintCellsBackground 請使用 方法。 如果您手動繪製整個資料列及其儲存格的內容,請將 HandledEventArgs.Handled 屬性設定為 true
。 當 為 true
時 HandledEventArgs.Handled , CellPainting 不會發生 和 RowPostPaint 事件。
適用於
另請參閱
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應