共用方式為


VisualStyleRenderer.DrawText 方法

定義

在指定的界限內繪製文字。

多載

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

在指定的週框中繪製文字,並選擇顯示暫止作用的文字選項和套用其他文字格式的選項。

DrawText(IDeviceContext, Rectangle, String)

使用預設格式在指定的界限內繪製文字。

DrawText(IDeviceContext, Rectangle, String, Boolean)

在指定的界限中繪製文字,並選擇顯示暫止作用的文字選項。

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

在指定的週框中繪製文字,並選擇顯示暫止作用的文字選項和套用其他文字格式的選項。

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

Rectangle,要在其中繪製文字。

textToDraw
String

要繪製的文字。

drawDisabled
Boolean

true 表示繪製變灰的文字,否則為 false

flags
TextFormatFlags

TextFormatFlags 值的位元組合。

例外狀況

dcnull

適用於

DrawText(IDeviceContext, Rectangle, String)

使用預設格式在指定的界限內繪製文字。

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

Rectangle,要在其中繪製文字。

textToDraw
String

要繪製的文字。

例外狀況

dcnull

適用於

DrawText(IDeviceContext, Rectangle, String, Boolean)

在指定的界限中繪製文字,並選擇顯示暫止作用的文字選項。

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

Rectangle,要在其中繪製文字。

textToDraw
String

要繪製的文字。

drawDisabled
Boolean

true 表示繪製變灰的文字,否則為 false

例外狀況

dcnull

適用於