DataGridViewRow.PaintCells 方法
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
在当前行中绘制单元格。
protected public:
virtual void PaintCells(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 PaintCells(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 PaintCells : System.Drawing.Graphics * System.Drawing.Rectangle * System.Drawing.Rectangle * int * System.Windows.Forms.DataGridViewElementStates * bool * bool * System.Windows.Forms.DataGridViewPaintParts -> unit
override this.PaintCells : 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 PaintCells (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
用于绘制 DataGridViewRow 的 Graphics。
- clipBounds
- Rectangle
Rectangle,它表示需要绘制的 DataGridView 区域。
- rowBounds
- Rectangle
一个 Rectangle,包含正在绘制的 DataGridViewRow 的边界。
- rowIndex
- Int32
当前所绘制的单元格的行索引。
- rowState
- DataGridViewElementStates
用于指定行的状态的 DataGridViewElementStates 值的按位组合。
- isFirstDisplayedRow
- Boolean
若要指示当前行是 DataGridView 中显示的第一行,则为 true
;否则为 false
。
- isLastVisibleRow
- Boolean
若要指示当前行是 DataGridView(已将 Visible 属性设置为 true
)中的最后一行,则为 true
;否则为 false
。
- paintParts
- DataGridViewPaintParts
用于指示要绘制的单元格部分的 DataGridViewPaintParts 值的按位组合。
行尚未添加到 DataGridView 控件。
paintParts
不是 DataGridViewPaintParts 值的有效按位组合。
控件 DataGridView 调用此方法来绘制行中的单元格,除非事件的处理程序 DataGridView.RowPrePaint 将 HandledEventArgs.Handled 属性设置为 true
。 有关详细信息,请参阅 Paint。
产品 | 版本 |
---|---|
.NET Framework | 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
Windows Desktop | 3.0, 3.1, 5, 6, 7, 8, 9, 10 |