DataGridViewRow.Paint 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
把現在這排油漆。
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,且性質設定Visible為 true;否則,。 false
例外狀況
該列位於控制 DataGridView 列中,且 rowIndex 小於或大於控制列數減一。
備註
控制項呼叫 DataGridView 此方法來繪製該列。
呼叫此方法會提升事件。DataGridView.RowPrePaint 若事件的處理器未將屬性設 HandledEventArgs.Handled 為 true,此方法也會呼叫 PaintHeader and PaintCells 方法並引發事件 DataGridView.RowPostPaint 。
適用於
另請參閱
- DataGridView
- RowPrePaint
- RowPostPaint
- PaintHeader(Graphics, Rectangle, Rectangle, Int32, DataGridViewElementStates, Boolean, Boolean, DataGridViewPaintParts)
- PaintCells(Graphics, Rectangle, Rectangle, Int32, DataGridViewElementStates, Boolean, Boolean, DataGridViewPaintParts)
- Windows 表單 DataGridView 控制項縮放最佳實務