DataGridViewRow.PaintHeader 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
會繪製當前列的標頭儲存格。
protected public:
virtual void PaintHeader(System::Drawing::Graphics ^ graphics, System::Drawing::Rectangle clipBounds, System::Drawing::Rectangle rowBounds, int rowIndex, System::Windows::Forms::DataGridViewElementStates rowState, bool isFirstDisplayedRow, bool isLastVisibleRow, System::Windows::Forms::DataGridViewPaintParts paintParts);
protected internal virtual void PaintHeader(System.Drawing.Graphics graphics, System.Drawing.Rectangle clipBounds, System.Drawing.Rectangle rowBounds, int rowIndex, System.Windows.Forms.DataGridViewElementStates rowState, bool isFirstDisplayedRow, bool isLastVisibleRow, System.Windows.Forms.DataGridViewPaintParts paintParts);
abstract member PaintHeader : System.Drawing.Graphics * System.Drawing.Rectangle * System.Drawing.Rectangle * int * System.Windows.Forms.DataGridViewElementStates * bool * bool * System.Windows.Forms.DataGridViewPaintParts -> unit
override this.PaintHeader : System.Drawing.Graphics * System.Drawing.Rectangle * System.Drawing.Rectangle * int * System.Windows.Forms.DataGridViewElementStates * bool * bool * System.Windows.Forms.DataGridViewPaintParts -> unit
Protected Friend Overridable Sub PaintHeader (graphics As Graphics, clipBounds As Rectangle, rowBounds As Rectangle, rowIndex As Integer, rowState As DataGridViewElementStates, isFirstDisplayedRow As Boolean, isLastVisibleRow As Boolean, paintParts As DataGridViewPaintParts)
參數
- 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
- paintParts
- DataGridViewPaintParts
一個位元組合 DataGridViewPaintParts 的值,指示要繪製的儲存格部分。
例外狀況
該列尚未被 DataGridView 加入控制組。
paintParts 在一個無效的位元組合 DataGridViewPaintParts 值中。
備註
DataGridView控制項呼叫此方法來繪製列標頭,除非事件的處理器DataGridView.RowPrePaint將屬性設HandledEventArgs.Handled為 true。 如需詳細資訊,請參閱Paint。