DataGridTextBoxColumn.PaintText 方法

定义

在指定位置处绘制指定文本和周围边框。Draws the specified text and surrounding rectangle at the specified location.

重载

PaintText(Graphics, Rectangle, String, Boolean)

在给定位置处依据指定的对齐方式绘制文本和边框。Draws the text and rectangle at the given location with the specified alignment.

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

在指定位置用指定的颜色和对齐方式绘制文本和边框。Draws the text and rectangle at the specified location with the specified colors and alignment.

PaintText(Graphics, Rectangle, String, Boolean)

在给定位置处依据指定的对齐方式绘制文本和边框。Draws the text and rectangle at the given location with the specified alignment.

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 对象,它用于绘制字符串。A Graphics object used to draw the string.

bounds
Rectangle

一个 Rectangle,它包含矩形的边界数据。A Rectangle which contains the boundary data of the rectangle.

text
String

要绘制到屏幕上的字符串。The string to be drawn to the screen.

alignToRight
Boolean

指示文本是否为右对齐的值。A value indicating whether the text is right-aligned.

注解

PaintText方法使用 DataFormats.Format 具有属性的对象集 Format 来设置值的格式,然后将其绘制到屏幕上。The PaintText method uses the DataFormats.Format object set with the Format property to format the value before drawing it to the screen.

Paint 方法调用 PaintText 方法。The Paint method calls the PaintText method.

另请参阅

适用于

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

在指定位置用指定的颜色和对齐方式绘制文本和边框。Draws the text and rectangle at the specified location with the specified colors and alignment.

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 对象,它用于绘制字符串。A Graphics object used to draw the string.

textBounds
Rectangle

一个 Rectangle,它包含矩形的边界数据。A Rectangle which contains the boundary data of the rectangle.

text
String

要绘制到屏幕上的字符串。The string to be drawn to the screen.

backBrush
Brush

一个 Brush,它确定矩形的背景色A Brush that determines the rectangle's background color

foreBrush
Brush

一个 Brush,它确定矩形的前景色。A Brush that determines the rectangles foreground color.

alignToRight
Boolean

指示文本是否为右对齐的值。A value indicating whether the text is right-aligned.

注解

PaintText方法使用 Format 属性来设置值的格式,然后将其绘制到屏幕上。The PaintText method uses the Format property to format the value before drawing it to the screen.

Paint 方法调用 PaintText 方法。The Paint method calls the PaintText method.

另请参阅

适用于