英語で読む

次の方法で共有


Graphics.DrawString メソッド

定義

指定した Brush オブジェクトと Font オブジェクトを使用して、指定した位置に指定したテキスト文字列を描画します。

オーバーロード

DrawString(String, Font, Brush, Single, Single, StringFormat)

指定した StringFormatの書式設定属性を使用して、指定した BrushFont オブジェクトを使用して、指定した位置に指定したテキスト文字列を描画します。

DrawString(ReadOnlySpan<Char>, Font, Brush, Single, Single, StringFormat)

指定した StringFormatの書式設定属性を使用して、指定した BrushFont オブジェクトを使用して、指定した位置に指定したテキスト文字列を描画します。

DrawString(String, Font, Brush, Single, Single)

指定した Brush オブジェクトと Font オブジェクトを使用して、指定した位置に指定したテキスト文字列を描画します。

DrawString(String, Font, Brush, RectangleF, StringFormat)

指定した StringFormatの書式設定属性を使用して、指定した BrushFont オブジェクトを使用して、指定した四角形に指定したテキスト文字列を描画します。

DrawString(String, Font, Brush, PointF, StringFormat)

指定した StringFormatの書式設定属性を使用して、指定した BrushFont オブジェクトを使用して、指定した位置に指定したテキスト文字列を描画します。

DrawString(ReadOnlySpan<Char>, Font, Brush, Single, Single)

指定した Brush オブジェクトと Font オブジェクトを使用して、指定した位置に指定したテキスト文字列を描画します。

DrawString(ReadOnlySpan<Char>, Font, Brush, PointF, StringFormat)

指定した StringFormatの書式設定属性を使用して、指定した BrushFont オブジェクトを使用して、指定した位置に指定したテキスト文字列を描画します。

DrawString(String, Font, Brush, RectangleF)

指定した Brush オブジェクトと Font オブジェクトを使用して、指定した四角形に指定したテキスト文字列を描画します。

DrawString(String, Font, Brush, PointF)

指定した Brush オブジェクトと Font オブジェクトを使用して、指定した位置に指定したテキスト文字列を描画します。

DrawString(ReadOnlySpan<Char>, Font, Brush, RectangleF)

指定した Brush オブジェクトと Font オブジェクトを使用して、指定した四角形に指定したテキスト文字列を描画します。

DrawString(ReadOnlySpan<Char>, Font, Brush, PointF)

指定した Brush オブジェクトと Font オブジェクトを使用して、指定した位置に指定したテキスト文字列を描画します。

DrawString(ReadOnlySpan<Char>, Font, Brush, RectangleF, StringFormat)

指定した StringFormatの書式設定属性を使用して、指定した BrushFont オブジェクトを使用して、指定した四角形に指定したテキスト文字列を描画します。

DrawString(String, Font, Brush, Single, Single, StringFormat)

ソース:
Graphics.cs
ソース:
Graphics.cs
ソース:
Graphics.cs
ソース:
Graphics.cs
ソース:
Graphics.cs

指定した StringFormatの書式設定属性を使用して、指定した BrushFont オブジェクトを使用して、指定した位置に指定したテキスト文字列を描画します。

public void DrawString (string? s, System.Drawing.Font font, System.Drawing.Brush brush, float x, float y, System.Drawing.StringFormat? format);
public void DrawString (string s, System.Drawing.Font font, System.Drawing.Brush brush, float x, float y, System.Drawing.StringFormat format);

パラメーター

s
String

描画する文字列。

font
Font

文字列のテキスト形式を定義する Font

brush
Brush

描画されたテキストの色とテクスチャを決定する Brush

x
Single

描画されたテキストの左上隅の x 座標。

y
Single

描画されたテキストの左上隅の y 座標。

format
StringFormat

描画されたテキストに適用される書式属性 (行間や配置など) を指定する StringFormat

例外

brushnullです。

-又は-

snullです。

次のコード例は Windows フォームで使用できるように設計されており、Paint イベント ハンドラーのパラメーターである PaintEventArgseが必要です。 このコードは、次のアクションを実行します。

  • 描画するテキスト文字列を作成します。

  • フォントを Arial (16pt) として定義します。

  • 描画するソリッドの黒いブラシを作成します。

  • テキストを描画する左上隅のポイントの座標を作成します。

  • 垂直方向に描画する文字列の形式を設定します。

  • フォント、ブラシ、変換先、書式を使用して、文字列を画面に描画します。

public void DrawStringFloatFormat(PaintEventArgs e)
{
             
    // Create string to draw.
    String drawString = "Sample Text";
             
    // Create font and brush.
    Font drawFont = new Font("Arial", 16);
    SolidBrush drawBrush = new SolidBrush(Color.Black);
             
    // Create point for upper-left corner of drawing.
    float x = 150.0F;
    float y =  50.0F;
             
    // Set format of string.
    StringFormat drawFormat = new StringFormat();
    drawFormat.FormatFlags = StringFormatFlags.DirectionVertical;
             
    // Draw string to screen.
    e.Graphics.DrawString(drawString, drawFont, drawBrush, x, y, drawFormat);
}

こちらもご覧ください

適用対象

.NET 9 およびその他のバージョン
製品 バージョン
.NET 6, 7, 8, 9
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9

DrawString(ReadOnlySpan<Char>, Font, Brush, Single, Single, StringFormat)

ソース:
Graphics.cs
ソース:
Graphics.cs
ソース:
Graphics.cs

指定した StringFormatの書式設定属性を使用して、指定した BrushFont オブジェクトを使用して、指定した位置に指定したテキスト文字列を描画します。

public void DrawString (ReadOnlySpan<char> s, System.Drawing.Font font, System.Drawing.Brush brush, float x, float y, System.Drawing.StringFormat? format);

パラメーター

s
ReadOnlySpan<Char>

描画する文字列。

font
Font

文字列のテキスト形式を定義する Font

brush
Brush

描画されたテキストの色とテクスチャを決定する Brush

x
Single

描画されたテキストの左上隅の x 座標。

y
Single

描画されたテキストの左上隅の y 座標。

format
StringFormat

描画されたテキストに適用される書式属性 (行間や配置など) を指定する StringFormat

適用対象

.NET 9 およびその他のバージョン
製品 バージョン
.NET 8, 9
Windows Desktop 8, 9

DrawString(String, Font, Brush, Single, Single)

ソース:
Graphics.cs
ソース:
Graphics.cs
ソース:
Graphics.cs
ソース:
Graphics.cs
ソース:
Graphics.cs

指定した Brush オブジェクトと Font オブジェクトを使用して、指定した位置に指定したテキスト文字列を描画します。

public void DrawString (string? s, System.Drawing.Font font, System.Drawing.Brush brush, float x, float y);
public void DrawString (string s, System.Drawing.Font font, System.Drawing.Brush brush, float x, float y);

パラメーター

s
String

描画する文字列。

font
Font

文字列のテキスト形式を定義する Font

brush
Brush

描画されたテキストの色とテクスチャを決定する Brush

x
Single

描画されたテキストの左上隅の x 座標。

y
Single

描画されたテキストの左上隅の y 座標。

例外

brushnullです。

-又は-

snullです。

次のコード例は Windows フォームで使用できるように設計されており、Paint イベント ハンドラーのパラメーターである PaintEventArgseが必要です。 このコードは、次のアクションを実行します。

  • 描画するテキスト文字列を作成します。

  • フォントを Arial (16pt) として定義します。

  • 描画に使用する黒いソリッド ブラシを作成します。

  • テキストを描画する左上隅のポイントを作成します。

  • フォント、ブラシ、および変換先のポイントを使用して、文字列を画面に描画します。

public void DrawStringFloat(PaintEventArgs e)
{
             
    // Create string to draw.
    String drawString = "Sample Text";
             
    // Create font and brush.
    Font drawFont = new Font("Arial", 16);
    SolidBrush drawBrush = new SolidBrush(Color.Black);
             
    // Create point for upper-left corner of drawing.
    float x = 150.0F;
    float y = 150.0F;
             
    // Draw string to screen.
    e.Graphics.DrawString(drawString, drawFont, drawBrush, x, y);
}

こちらもご覧ください

適用対象

.NET 9 およびその他のバージョン
製品 バージョン
.NET 6, 7, 8, 9
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9

DrawString(String, Font, Brush, RectangleF, StringFormat)

ソース:
Graphics.cs
ソース:
Graphics.cs
ソース:
Graphics.cs
ソース:
Graphics.cs
ソース:
Graphics.cs

指定した StringFormatの書式設定属性を使用して、指定した BrushFont オブジェクトを使用して、指定した四角形に指定したテキスト文字列を描画します。

public void DrawString (string? s, System.Drawing.Font font, System.Drawing.Brush brush, System.Drawing.RectangleF layoutRectangle, System.Drawing.StringFormat? format);
public void DrawString (string s, System.Drawing.Font font, System.Drawing.Brush brush, System.Drawing.RectangleF layoutRectangle, System.Drawing.StringFormat format);

パラメーター

s
String

描画する文字列。

font
Font

文字列のテキスト形式を定義する Font

brush
Brush

描画されたテキストの色とテクスチャを決定する Brush

layoutRectangle
RectangleF

RectangleF 描画テキストの位置を指定する構造体です。

format
StringFormat

描画されたテキストに適用される書式属性 (行間や配置など) を指定する StringFormat

例外

brushnullです。

-又は-

snullです。

次のコード例は Windows フォームで使用できるように設計されており、Paint イベント ハンドラーのパラメーターである PaintEventArgseが必要です。 このコードは、次のアクションを実行します。

  • 描画するテキスト文字列を作成します。

  • フォントを Arial (16pt) として定義します。

  • 描画するソリッドの黒いブラシを作成します。

  • テキストを描画する四角形を作成します。

  • 四角形を画面に描画します。

  • 文字列の書式を四角形内の中央に設定します。

  • フォント、ブラシ、および変換先の四角形を使用して、文字列を画面に描画します。

public void DrawStringRectangleFFormat(PaintEventArgs e)
{
             
    // Create string to draw.
    String drawString = "Sample Text";
             
    // Create font and brush.
    Font drawFont = new Font("Arial", 16);
    SolidBrush drawBrush = new SolidBrush(Color.Black);
             
    // Create rectangle for drawing.
    float x = 150.0F;
    float y = 150.0F;
    float width = 200.0F;
    float height = 50.0F;
    RectangleF drawRect = new RectangleF(x, y, width, height);
             
    // Draw rectangle to screen.
    Pen blackPen = new Pen(Color.Black);
    e.Graphics.DrawRectangle(blackPen, x, y, width, height);
             
    // Set format of string.
    StringFormat drawFormat = new StringFormat();
    drawFormat.Alignment = StringAlignment.Center;
             
    // Draw string to screen.
    e.Graphics.DrawString(drawString, drawFont, drawBrush, drawRect, drawFormat);
}

注釈

s パラメーターで表されるテキストは、layoutRectangle パラメーターで表される四角形内に描画されます。 テキストが四角形内に収まらない場合は、format パラメーターで特に指定しない限り、最も近い単語で切り捨てられます。

こちらもご覧ください

適用対象

.NET 9 およびその他のバージョン
製品 バージョン
.NET 6, 7, 8, 9
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9

DrawString(String, Font, Brush, PointF, StringFormat)

ソース:
Graphics.cs
ソース:
Graphics.cs
ソース:
Graphics.cs
ソース:
Graphics.cs
ソース:
Graphics.cs

指定した StringFormatの書式設定属性を使用して、指定した BrushFont オブジェクトを使用して、指定した位置に指定したテキスト文字列を描画します。

public void DrawString (string? s, System.Drawing.Font font, System.Drawing.Brush brush, System.Drawing.PointF point, System.Drawing.StringFormat? format);
public void DrawString (string s, System.Drawing.Font font, System.Drawing.Brush brush, System.Drawing.PointF point, System.Drawing.StringFormat format);

パラメーター

s
String

描画する文字列。

font
Font

文字列のテキスト形式を定義する Font

brush
Brush

描画されたテキストの色とテクスチャを決定する Brush

point
PointF

PointF 描画されたテキストの左上隅を指定する構造体です。

format
StringFormat

描画されたテキストに適用される書式属性 (行間や配置など) を指定する StringFormat

例外

brushnullです。

-又は-

snullです。

次のコード例は Windows フォームで使用できるように設計されており、Paint イベント ハンドラーのパラメーターである PaintEventArgseが必要です。 このコードは、次のアクションを実行します。

  • 描画するテキスト文字列を作成します。

  • フォントを Arial (16pt) として定義します。

  • 描画するソリッドの黒いブラシを作成します。

  • テキストを描画する左上隅のポイントを作成します。

  • 垂直方向に描画する文字列の形式を設定します。

  • フォント、ブラシ、変換先、書式を使用して、文字列を画面に描画します。

public void DrawStringPointFFormat(PaintEventArgs e)
{
             
    // Create string to draw.
    String drawString = "Sample Text";
             
    // Create font and brush.
    Font drawFont = new Font("Arial", 16);
    SolidBrush drawBrush = new SolidBrush(Color.Black);
             
    // Create point for upper-left corner of drawing.
    PointF drawPoint = new PointF(150.0F, 50.0F);
             
    // Set format of string.
    StringFormat drawFormat = new StringFormat();
    drawFormat.FormatFlags = StringFormatFlags.DirectionVertical;
             
    // Draw string to screen.
    e.Graphics.DrawString(drawString, drawFont, drawBrush, drawPoint, drawFormat);
}

こちらもご覧ください

適用対象

.NET 9 およびその他のバージョン
製品 バージョン
.NET 6, 7, 8, 9
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9

DrawString(ReadOnlySpan<Char>, Font, Brush, Single, Single)

ソース:
Graphics.cs
ソース:
Graphics.cs
ソース:
Graphics.cs

指定した Brush オブジェクトと Font オブジェクトを使用して、指定した位置に指定したテキスト文字列を描画します。

public void DrawString (ReadOnlySpan<char> s, System.Drawing.Font font, System.Drawing.Brush brush, float x, float y);

パラメーター

s
ReadOnlySpan<Char>

描画する文字列。

font
Font

文字列のテキスト形式を定義する Font

brush
Brush

描画されたテキストの色とテクスチャを決定する Brush

x
Single

描画されたテキストの左上隅の x 座標。

y
Single

描画されたテキストの左上隅の y 座標。

適用対象

.NET 9 およびその他のバージョン
製品 バージョン
.NET 8, 9
Windows Desktop 8, 9

DrawString(ReadOnlySpan<Char>, Font, Brush, PointF, StringFormat)

ソース:
Graphics.cs
ソース:
Graphics.cs
ソース:
Graphics.cs

指定した StringFormatの書式設定属性を使用して、指定した BrushFont オブジェクトを使用して、指定した位置に指定したテキスト文字列を描画します。

public void DrawString (ReadOnlySpan<char> s, System.Drawing.Font font, System.Drawing.Brush brush, System.Drawing.PointF point, System.Drawing.StringFormat? format);

パラメーター

s
ReadOnlySpan<Char>

描画する文字列。

font
Font

文字列のテキスト形式を定義する Font

brush
Brush

描画されたテキストの色とテクスチャを決定する Brush

point
PointF

PointF 描画されたテキストの左上隅を指定する構造体です。

format
StringFormat

描画されたテキストに適用される書式属性 (行間や配置など) を指定する StringFormat

適用対象

.NET 9 およびその他のバージョン
製品 バージョン
.NET 8, 9
Windows Desktop 8, 9

DrawString(String, Font, Brush, RectangleF)

ソース:
Graphics.cs
ソース:
Graphics.cs
ソース:
Graphics.cs
ソース:
Graphics.cs
ソース:
Graphics.cs

指定した Brush オブジェクトと Font オブジェクトを使用して、指定した四角形に指定したテキスト文字列を描画します。

public void DrawString (string? s, System.Drawing.Font font, System.Drawing.Brush brush, System.Drawing.RectangleF layoutRectangle);
public void DrawString (string s, System.Drawing.Font font, System.Drawing.Brush brush, System.Drawing.RectangleF layoutRectangle);

パラメーター

s
String

描画する文字列。

font
Font

文字列のテキスト形式を定義する Font

brush
Brush

描画されたテキストの色とテクスチャを決定する Brush

layoutRectangle
RectangleF

RectangleF 描画テキストの位置を指定する構造体です。

例外

brushnullです。

-又は-

snullです。

次のコード例は Windows フォームで使用できるように設計されており、Paint イベント ハンドラーのパラメーターである PaintEventArgseが必要です。 このコードは、次のアクションを実行します。

  • 描画するテキスト文字列を作成します。

  • フォントを Arial (16pt) として定義します。

  • 描画するソリッドの黒いブラシを作成します。

  • テキストを描画する四角形を作成します。

  • 四角形を画面に描画します。

  • フォント、ブラシ、および変換先の四角形を使用して、文字列を画面に描画します。

public void DrawStringRectangleF(PaintEventArgs e)
{
             
    // Create string to draw.
    String drawString = "Sample Text";
             
    // Create font and brush.
    Font drawFont = new Font("Arial", 16);
    SolidBrush drawBrush = new SolidBrush(Color.Black);
             
    // Create rectangle for drawing.
    float x = 150.0F;
    float y = 150.0F;
    float width = 200.0F;
    float height = 50.0F;
    RectangleF drawRect = new RectangleF(x, y, width, height);
             
    // Draw rectangle to screen.
    Pen blackPen = new Pen(Color.Black);
    e.Graphics.DrawRectangle(blackPen, x, y, width, height);
             
    // Draw string to screen.
    e.Graphics.DrawString(drawString, drawFont, drawBrush, drawRect);
}

注釈

s パラメーターで表されるテキストは、layoutRectangle パラメーターで表される四角形内に描画されます。 テキストが四角形内に収まらない場合は、最も近い単語で切り捨てられます。 四角形内での文字列の描画方法をさらに操作するには、StringFormatを受け取る DrawString オーバーロードを使用します。

こちらもご覧ください

適用対象

.NET 9 およびその他のバージョン
製品 バージョン
.NET 6, 7, 8, 9
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9

DrawString(String, Font, Brush, PointF)

ソース:
Graphics.cs
ソース:
Graphics.cs
ソース:
Graphics.cs
ソース:
Graphics.cs
ソース:
Graphics.cs

指定した Brush オブジェクトと Font オブジェクトを使用して、指定した位置に指定したテキスト文字列を描画します。

public void DrawString (string? s, System.Drawing.Font font, System.Drawing.Brush brush, System.Drawing.PointF point);
public void DrawString (string s, System.Drawing.Font font, System.Drawing.Brush brush, System.Drawing.PointF point);

パラメーター

s
String

描画する文字列。

font
Font

文字列のテキスト形式を定義する Font

brush
Brush

描画されたテキストの色とテクスチャを決定する Brush

point
PointF

PointF 描画されたテキストの左上隅を指定する構造体です。

例外

brushnullです。

-又は-

snullです。

次のコード例は Windows フォームで使用できるように設計されており、Paint イベント ハンドラーのパラメーターである PaintEventArgseが必要です。 このコードは、次のアクションを実行します。

  • 描画するテキスト文字列を作成します。

  • フォントを Arial (16pt) として定義します。

  • 描画するソリッドの黒いブラシを作成します。

  • テキストを描画する左上隅のポイントを作成します。

  • フォント、ブラシ、および変換先のポイントを使用して、文字列を画面に描画します。

public void DrawStringPointF(PaintEventArgs e)
{
             
    // Create string to draw.
    String drawString = "Sample Text";
             
    // Create font and brush.
    Font drawFont = new Font("Arial", 16);
    SolidBrush drawBrush = new SolidBrush(Color.Black);
             
    // Create point for upper-left corner of drawing.
    PointF drawPoint = new PointF(150.0F, 150.0F);
             
    // Draw string to screen.
    e.Graphics.DrawString(drawString, drawFont, drawBrush, drawPoint);
}

こちらもご覧ください

適用対象

.NET 9 およびその他のバージョン
製品 バージョン
.NET 6, 7, 8, 9
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9

DrawString(ReadOnlySpan<Char>, Font, Brush, RectangleF)

ソース:
Graphics.cs
ソース:
Graphics.cs
ソース:
Graphics.cs

指定した Brush オブジェクトと Font オブジェクトを使用して、指定した四角形に指定したテキスト文字列を描画します。

public void DrawString (ReadOnlySpan<char> s, System.Drawing.Font font, System.Drawing.Brush brush, System.Drawing.RectangleF layoutRectangle);

パラメーター

s
ReadOnlySpan<Char>

描画する文字列。

font
Font

文字列のテキスト形式を定義する Font

brush
Brush

描画されたテキストの色とテクスチャを決定する Brush

layoutRectangle
RectangleF

RectangleF 描画テキストの位置を指定する構造体です。

注釈

s パラメーターで表されるテキストは、layoutRectangle パラメーターで表される四角形内に描画されます。 テキストが四角形内に収まらない場合は、最も近い単語で切り捨てられます。 四角形内での文字列の描画方法をさらに操作するには、StringFormatを受け取る DrawString(ReadOnlySpan<Char>, Font, Brush, RectangleF, StringFormat) オーバーロードを使用します。

適用対象

.NET 9 およびその他のバージョン
製品 バージョン
.NET 8, 9
Windows Desktop 8, 9

DrawString(ReadOnlySpan<Char>, Font, Brush, PointF)

ソース:
Graphics.cs
ソース:
Graphics.cs
ソース:
Graphics.cs

指定した Brush オブジェクトと Font オブジェクトを使用して、指定した位置に指定したテキスト文字列を描画します。

public void DrawString (ReadOnlySpan<char> s, System.Drawing.Font font, System.Drawing.Brush brush, System.Drawing.PointF point);

パラメーター

s
ReadOnlySpan<Char>

描画する文字列。

font
Font

文字列のテキスト形式を定義する Font

brush
Brush

描画されたテキストの色とテクスチャを決定する Brush

point
PointF

PointF 描画されたテキストの左上隅を指定する構造体です。

適用対象

.NET 9 およびその他のバージョン
製品 バージョン
.NET 8, 9
Windows Desktop 8, 9

DrawString(ReadOnlySpan<Char>, Font, Brush, RectangleF, StringFormat)

ソース:
Graphics.cs
ソース:
Graphics.cs
ソース:
Graphics.cs

指定した StringFormatの書式設定属性を使用して、指定した BrushFont オブジェクトを使用して、指定した四角形に指定したテキスト文字列を描画します。

public void DrawString (ReadOnlySpan<char> s, System.Drawing.Font font, System.Drawing.Brush brush, System.Drawing.RectangleF layoutRectangle, System.Drawing.StringFormat? format);

パラメーター

s
ReadOnlySpan<Char>

描画する文字列。

font
Font

文字列のテキスト形式を定義する Font

brush
Brush

描画されたテキストの色とテクスチャを決定する Brush

layoutRectangle
RectangleF

RectangleF 描画テキストの位置を指定する構造体です。

format
StringFormat

描画されたテキストに適用される書式属性 (行間や配置など) を指定する StringFormat

適用対象

.NET 9 およびその他のバージョン
製品 バージョン
.NET 8, 9
Windows Desktop 8, 9