VisualStyleRenderer.DrawText Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Draws text in the specified bounds.
Overloads
DrawText(IDeviceContext, Rectangle, String, Boolean, TextFormatFlags) |
Draws text in the specified bounding rectangle with the option of displaying disabled text and applying other text formatting. |
DrawText(IDeviceContext, Rectangle, String) |
Draws text in the specified bounds using default formatting. |
DrawText(IDeviceContext, Rectangle, String, Boolean) |
Draws text in the specified bounds with the option of displaying disabled text. |
DrawText(IDeviceContext, Rectangle, String, Boolean, TextFormatFlags)
- Source:
- VisualStyleRenderer.cs
- Source:
- VisualStyleRenderer.cs
- Source:
- VisualStyleRenderer.cs
Draws text in the specified bounding rectangle with the option of displaying disabled text and applying other text formatting.
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)
Parameters
The IDeviceContext used to draw the text.
- textToDraw
- String
The text to draw.
- drawDisabled
- Boolean
true
to draw grayed-out text; otherwise, false
.
- flags
- TextFormatFlags
A bitwise combination of the TextFormatFlags values.
Exceptions
dc
is null
.
Applies to
DrawText(IDeviceContext, Rectangle, String)
- Source:
- VisualStyleRenderer.cs
- Source:
- VisualStyleRenderer.cs
- Source:
- VisualStyleRenderer.cs
Draws text in the specified bounds using default formatting.
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)
Parameters
The IDeviceContext used to draw the text.
- textToDraw
- String
The text to draw.
Exceptions
dc
is null
.
Applies to
DrawText(IDeviceContext, Rectangle, String, Boolean)
- Source:
- VisualStyleRenderer.cs
- Source:
- VisualStyleRenderer.cs
- Source:
- VisualStyleRenderer.cs
Draws text in the specified bounds with the option of displaying disabled text.
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)
Parameters
The IDeviceContext used to draw the text.
- textToDraw
- String
The text to draw.
- drawDisabled
- Boolean
true
to draw grayed-out text; otherwise, false
.
Exceptions
dc
is null
.