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
表示需要绘制的区域DataGridView的 ARectangle。
- rowBounds
- Rectangle
一个 Rectangle 包含所绘制的 DataGridViewRow 边界的边界。
- rowIndex
- Int32
要绘制的单元格的行索引。
- rowState
- DataGridViewElementStates
指定行状态的值的 DataGridViewElementStates 按位组合。
- isFirstDisplayedRow
- Boolean
true 如果指示当前行是否为显示在第一行, DataGridView则为 ;否则为 false。
- isLastVisibleRow
- Boolean
true指示当前行是否为属性设置为的最后一行DataGridViewVisible;否则为 false。true
例外
该行位于控件 DataGridView 中, rowIndex 小于零或大于控件中的行数减一。
注解
控件 DataGridView 调用此方法来绘制行。
调用此方法将 DataGridView.RowPrePaint 引发事件。 如果事件的处理程序未将 HandledEventArgs.Handled 属性 true设置为,此方法也会调用 PaintHeader 和 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 控件的最佳做法