语言

DataGridTextBoxColumn.PaintText 方法

定义

在指定位置绘制指定的文本和周围矩形。

重载

名称 说明
PaintText(Graphics, Rectangle, String, Boolean)

使用指定的对齐方式在给定位置绘制文本和矩形。

PaintText(Graphics, Rectangle, String, Brush, Brush, Boolean)

使用指定的颜色和对齐方式在指定位置绘制文本和矩形。

PaintText(Graphics, Rectangle, String, Boolean)

Source:
DataGridTextBoxColumn.cs
Source:
DataGridTextBoxColumn.cs

使用指定的对齐方式在给定位置绘制文本和矩形。

protected:
 void PaintText(System::Drawing::Graphics ^ g, System::Drawing::Rectangle bounds, System::String ^ text, bool alignToRight);
protected void PaintText(System.Drawing.Graphics g, System.Drawing.Rectangle bounds, string text, bool alignToRight);
member this.PaintText : System.Drawing.Graphics * System.Drawing.Rectangle * string * bool -> unit
Protected Sub PaintText (g As Graphics, bounds As Rectangle, text As String, alignToRight As Boolean)

参数

g
Graphics

Graphics用于绘制字符串的对象。

bounds
Rectangle

一个 Rectangle 包含矩形的边界数据。

text
String

要绘制到屏幕的字符串。

alignToRight
Boolean

一个值,该值指示文本是否右对齐。

注解

该方法 PaintText 使用具有 DataFormats.Format 属性的对象集 Format 来设置值的格式,然后再将其绘制到屏幕。

该方法 Paint 调用该方法 PaintText 。

另请参阅

适用于

PaintText(Graphics, Rectangle, String, Brush, Brush, Boolean)

Source:
DataGridTextBoxColumn.cs
Source:
DataGridTextBoxColumn.cs

使用指定的颜色和对齐方式在指定位置绘制文本和矩形。

protected:
 void PaintText(System::Drawing::Graphics ^ g, System::Drawing::Rectangle textBounds, System::String ^ text, System::Drawing::Brush ^ backBrush, System::Drawing::Brush ^ foreBrush, bool alignToRight);
protected void PaintText(System.Drawing.Graphics g, System.Drawing.Rectangle textBounds, string text, System.Drawing.Brush backBrush, System.Drawing.Brush foreBrush, bool alignToRight);
member this.PaintText : System.Drawing.Graphics * System.Drawing.Rectangle * string * System.Drawing.Brush * System.Drawing.Brush * bool -> unit
Protected Sub PaintText (g As Graphics, textBounds As Rectangle, text As String, backBrush As Brush, foreBrush As Brush, alignToRight As Boolean)

参数

g
Graphics

Graphics用于绘制字符串的对象。

textBounds
Rectangle

一个 Rectangle 包含矩形的边界数据。

text
String

要绘制到屏幕的字符串。

backBrush
Brush

确定矩形的背景色的 A Brush 。

foreBrush
Brush

确定矩形前景色的 A Brush 。

alignToRight
Boolean

一个值,该值指示文本是否右对齐。

注解

该方法 PaintText 使用 Format 属性设置值的格式,然后再将其绘制到屏幕。

该方法 Paint 调用该方法 PaintText 。

另请参阅

适用于