VisualStyleRenderer.DrawText 方法

定义

绘制指定边界中的文本。

重载

名称 说明
DrawText(IDeviceContext, Rectangle, String, Boolean, TextFormatFlags)

使用显示禁用的文本和应用其他文本格式的选项,在指定的边界矩形中绘制文本。

DrawText(IDeviceContext, Rectangle, String)

使用默认格式绘制指定边界中的文本。

DrawText(IDeviceContext, Rectangle, String, Boolean)

使用显示禁用文本的选项在指定的边界中绘制文本。

DrawText(IDeviceContext, Rectangle, String, Boolean, TextFormatFlags)

Source:
VisualStyleRenderer.cs
Source:
VisualStyleRenderer.cs
Source:
VisualStyleRenderer.cs
Source:
VisualStyleRenderer.cs
Source:
VisualStyleRenderer.cs

使用显示禁用的文本和应用其他文本格式的选项,在指定的边界矩形中绘制文本。

public:
 void DrawText(System::Drawing::IDeviceContext ^ dc, System::Drawing::Rectangle bounds, System::String ^ textToDraw, bool drawDisabled, System::Windows::Forms::TextFormatFlags flags);
public void DrawText(System.Drawing.IDeviceContext dc, System.Drawing.Rectangle bounds, string textToDraw, bool drawDisabled, System.Windows.Forms.TextFormatFlags flags);
public void DrawText(System.Drawing.IDeviceContext dc, System.Drawing.Rectangle bounds, string? textToDraw, bool drawDisabled, System.Windows.Forms.TextFormatFlags flags);
member this.DrawText : System.Drawing.IDeviceContext * System.Drawing.Rectangle * string * bool * System.Windows.Forms.TextFormatFlags -> unit
Public Sub DrawText (dc As IDeviceContext, bounds As Rectangle, textToDraw As String, drawDisabled As Boolean, flags As TextFormatFlags)

参数

dc
IDeviceContext

IDeviceContext用于绘制文本。

bounds
Rectangle

要在其中绘制文本的 A Rectangle

textToDraw
String

要绘制的文本。

drawDisabled
Boolean

true 绘制灰显文本;否则,为 false.

flags
TextFormatFlags

值的按位组合 TextFormatFlags

例外

dcnull

适用于

DrawText(IDeviceContext, Rectangle, String)

Source:
VisualStyleRenderer.cs
Source:
VisualStyleRenderer.cs
Source:
VisualStyleRenderer.cs
Source:
VisualStyleRenderer.cs
Source:
VisualStyleRenderer.cs

使用默认格式绘制指定边界中的文本。

public:
 void DrawText(System::Drawing::IDeviceContext ^ dc, System::Drawing::Rectangle bounds, System::String ^ textToDraw);
public void DrawText(System.Drawing.IDeviceContext dc, System.Drawing.Rectangle bounds, string textToDraw);
public void DrawText(System.Drawing.IDeviceContext dc, System.Drawing.Rectangle bounds, string? textToDraw);
member this.DrawText : System.Drawing.IDeviceContext * System.Drawing.Rectangle * string -> unit
Public Sub DrawText (dc As IDeviceContext, bounds As Rectangle, textToDraw As String)

参数

dc
IDeviceContext

IDeviceContext用于绘制文本。

bounds
Rectangle

要在其中绘制文本的 A Rectangle

textToDraw
String

要绘制的文本。

例外

dcnull

适用于

DrawText(IDeviceContext, Rectangle, String, Boolean)

Source:
VisualStyleRenderer.cs
Source:
VisualStyleRenderer.cs
Source:
VisualStyleRenderer.cs
Source:
VisualStyleRenderer.cs
Source:
VisualStyleRenderer.cs

使用显示禁用文本的选项在指定的边界中绘制文本。

public:
 void DrawText(System::Drawing::IDeviceContext ^ dc, System::Drawing::Rectangle bounds, System::String ^ textToDraw, bool drawDisabled);
public void DrawText(System.Drawing.IDeviceContext dc, System.Drawing.Rectangle bounds, string textToDraw, bool drawDisabled);
public void DrawText(System.Drawing.IDeviceContext dc, System.Drawing.Rectangle bounds, string? textToDraw, bool drawDisabled);
member this.DrawText : System.Drawing.IDeviceContext * System.Drawing.Rectangle * string * bool -> unit
Public Sub DrawText (dc As IDeviceContext, bounds As Rectangle, textToDraw As String, drawDisabled As Boolean)

参数

dc
IDeviceContext

IDeviceContext用于绘制文本。

bounds
Rectangle

要在其中绘制文本的 A Rectangle

textToDraw
String

要绘制的文本。

drawDisabled
Boolean

true 绘制灰显文本;否则,为 false.

例外

dcnull

适用于