VisualStyleRenderer.DrawText 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
绘制指定边界中的文本。
重载
| 名称 | 说明 |
|---|---|
| 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)
参数
IDeviceContext用于绘制文本。
- textToDraw
- String
要绘制的文本。
- drawDisabled
- Boolean
true 绘制灰显文本;否则,为 false.
- flags
- TextFormatFlags
值的按位组合 TextFormatFlags 。
例外
dc 是 null。
适用于
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)
参数
IDeviceContext用于绘制文本。
- textToDraw
- String
要绘制的文本。
例外
dc 是 null。
适用于
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)
参数
IDeviceContext用于绘制文本。
- textToDraw
- String
要绘制的文本。
- drawDisabled
- Boolean
true 绘制灰显文本;否则,为 false.
例外
dc 是 null。