DataGridColumnStyle.Paint 方法

定义

在派生类中被重写时,在 DataGrid 控件中绘制列。When overridden in a derived class, paints the column in a DataGrid control.

重载

Paint(Graphics, Rectangle, CurrencyManager, Int32)

使用指定的 DataGridColumnStyleGraphicsRectangle 和行号绘制 CurrencyManagerPaints the DataGridColumnStyle with the specified Graphics, Rectangle, CurrencyManager, and row number.

Paint(Graphics, Rectangle, CurrencyManager, Int32, Boolean)

在派生类中被重写时,将绘制具有指定 DataGridColumnStyleGraphicsRectangle、行号和对齐方式的 CurrencyManagerWhen overridden in a derived class, paints a DataGridColumnStyle with the specified Graphics, Rectangle, CurrencyManager, row number, and alignment.

Paint(Graphics, Rectangle, CurrencyManager, Int32, Brush, Brush, Boolean)

绘制具有指定 DataGridColumnStyleGraphicsRectangle、行号、背景色、前景色和对齐方式的 CurrencyManagerPaints a DataGridColumnStyle with the specified Graphics, Rectangle, CurrencyManager, row number, background color, foreground color, and alignment.

Paint(Graphics, Rectangle, CurrencyManager, Int32)

使用指定的 DataGridColumnStyleGraphicsRectangle 和行号绘制 CurrencyManagerPaints the DataGridColumnStyle with the specified Graphics, Rectangle, CurrencyManager, and row number.

protected public:
 abstract void Paint(System::Drawing::Graphics ^ g, System::Drawing::Rectangle bounds, System::Windows::Forms::CurrencyManager ^ source, int rowNum);
protected internal abstract void Paint (System.Drawing.Graphics g, System.Drawing.Rectangle bounds, System.Windows.Forms.CurrencyManager source, int rowNum);
abstract member Paint : System.Drawing.Graphics * System.Drawing.Rectangle * System.Windows.Forms.CurrencyManager * int -> unit
Protected Friend MustOverride Sub Paint (g As Graphics, bounds As Rectangle, source As CurrencyManager, rowNum As Integer)

参数

g
Graphics

要绘制到的 GraphicsThe Graphics to draw to.

bounds
Rectangle

要在其中绘画的外围 RectangleThe bounding Rectangle to paint into.

source
CurrencyManager

该列所属的 CurrencyManager 控件的 DataGridThe CurrencyManager of the DataGrid control the column belongs to.

rowNum
Int32

所引用的基础数据中的行号。The number of the row in the underlying data being referred to.

适用于

Paint(Graphics, Rectangle, CurrencyManager, Int32, Boolean)

在派生类中被重写时,将绘制具有指定 DataGridColumnStyleGraphicsRectangle、行号和对齐方式的 CurrencyManagerWhen overridden in a derived class, paints a DataGridColumnStyle with the specified Graphics, Rectangle, CurrencyManager, row number, and alignment.

protected public:
 abstract void Paint(System::Drawing::Graphics ^ g, System::Drawing::Rectangle bounds, System::Windows::Forms::CurrencyManager ^ source, int rowNum, bool alignToRight);
protected internal abstract void Paint (System.Drawing.Graphics g, System.Drawing.Rectangle bounds, System.Windows.Forms.CurrencyManager source, int rowNum, bool alignToRight);
abstract member Paint : System.Drawing.Graphics * System.Drawing.Rectangle * System.Windows.Forms.CurrencyManager * int * bool -> unit
Protected Friend MustOverride Sub Paint (g As Graphics, bounds As Rectangle, source As CurrencyManager, rowNum As Integer, alignToRight As Boolean)

参数

g
Graphics

要绘制到的 GraphicsThe Graphics to draw to.

bounds
Rectangle

要在其中绘画的外围 RectangleThe bounding Rectangle to paint into.

source
CurrencyManager

该列所属的 CurrencyManager 控件的 DataGridThe CurrencyManager of the DataGrid control the column belongs to.

rowNum
Int32

所引用的基础数据中的行号。The number of the row in the underlying data being referred to.

alignToRight
Boolean

一个值,它指示该列的内容是否为右对齐。A value indicating whether to align the column's content to the right. 如果内容应为右对齐,则为 true;否则为 falsetrue if the content should be aligned to the right; otherwise false.

适用于

Paint(Graphics, Rectangle, CurrencyManager, Int32, Brush, Brush, Boolean)

绘制具有指定 DataGridColumnStyleGraphicsRectangle、行号、背景色、前景色和对齐方式的 CurrencyManagerPaints a DataGridColumnStyle with the specified Graphics, Rectangle, CurrencyManager, row number, background color, foreground color, and alignment.

protected public:
 virtual void Paint(System::Drawing::Graphics ^ g, System::Drawing::Rectangle bounds, System::Windows::Forms::CurrencyManager ^ source, int rowNum, System::Drawing::Brush ^ backBrush, System::Drawing::Brush ^ foreBrush, bool alignToRight);
protected internal virtual void Paint (System.Drawing.Graphics g, System.Drawing.Rectangle bounds, System.Windows.Forms.CurrencyManager source, int rowNum, System.Drawing.Brush backBrush, System.Drawing.Brush foreBrush, bool alignToRight);
abstract member Paint : System.Drawing.Graphics * System.Drawing.Rectangle * System.Windows.Forms.CurrencyManager * int * System.Drawing.Brush * System.Drawing.Brush * bool -> unit
override this.Paint : System.Drawing.Graphics * System.Drawing.Rectangle * System.Windows.Forms.CurrencyManager * int * System.Drawing.Brush * System.Drawing.Brush * bool -> unit
Protected Friend Overridable Sub Paint (g As Graphics, bounds As Rectangle, source As CurrencyManager, rowNum As Integer, backBrush As Brush, foreBrush As Brush, alignToRight As Boolean)

参数

g
Graphics

要绘制到的 GraphicsThe Graphics to draw to.

bounds
Rectangle

要在其中绘画的外围 RectangleThe bounding Rectangle to paint into.

source
CurrencyManager

该列所属的 CurrencyManager 控件的 DataGridThe CurrencyManager of the DataGrid control the column belongs to.

rowNum
Int32

所引用的基础数据表中的行号。The number of the row in the underlying data table being referred to.

backBrush
Brush

用于绘制背景色的 BrushA Brush used to paint the background color.

foreBrush
Brush

用于绘制前景色的 ColorA Color used to paint the foreground color.

alignToRight
Boolean

一个值,它指示内容是否为右对齐。A value indicating whether to align the content to the right. 如果内容为右对齐,则为 true;否则为 falsetrue if the content is aligned to the right, otherwise, false.

适用于