TextRendererとは? わかりやすく解説

TextRenderer クラス

メモ : このクラスは、.NET Framework version 2.0新しく追加されたものです。

テキスト計測および表示使用するメソッド提供します。このクラス継承できません。

名前空間: System.Windows.Forms
アセンブリ: System.Windows.Forms (system.windows.forms.dll 内)
構文構文

Public NotInheritable Class
 TextRenderer
public sealed class TextRenderer
public ref class TextRenderer sealed
public final class TextRenderer
public final class TextRenderer
解説解説

TextRenderer クラスには、Windows フォーム コントロール上のテキスト計測および描画使用できる一連の static メソッド用意されています。

TextFormatFlags パラメータ受け取る DrawText オーバーロード1 つ使用してテキスト描画方法操作できます。たとえば、TextRenderer既定動作では、グリフ突出部が収まるように、描画されるテキスト外接する四角形パディング追加されます。この余分な領域なしでテキストの行を描画する必要がある場合は、Size パラメータTextFormatFlags パラメータ受け取バージョンの DrawText および MeasureText を使用する必要があります例については、MeasureText(IDeviceContext,String,Font,Size,TextFormatFlags) のトピック参照してください

メモメモ

TextRenderer の DrawText メソッドでは、印刷サポートされていません。常に、Graphics クラスDrawString メソッド使用するようにしてください

使用例使用例

DrawText メソッド使用する方法次のコード例示します。この例を実行するには、コードWindows フォーム貼り付けフォームPaint イベント ハンドラから、e を PaintEventArgs として渡すことにより、RenderText1 呼び出します。

Private Sub RenderText1(ByVal
 e As PaintEventArgs)
    TextRenderer.DrawText(e.Graphics, "Regular Text",
 _
        Me.Font, New Point(10, 10), SystemColors.ControlText)

End Sub


private void RenderText1(PaintEventArgs e)
{
    TextRenderer.DrawText(e.Graphics, "Regular Text", this.Font,
 
        new Point(10, 10), SystemColors.ControlText);

}
継承階層継承階層
System.Object
  System.Windows.Forms.TextRenderer
スレッド セーフスレッド セーフ
この型の public static (Visual Basic では Shared) メンバはすべて、スレッド セーフです。インスタンス メンバ場合は、スレッド セーフであるとは限りません。
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

TextRenderer メソッド


パブリック メソッドパブリック メソッド

プロテクト メソッドプロテクト メソッド
参照参照

関連項目

TextRenderer クラス
System.Windows.Forms 名前空間

TextRenderer メンバ

テキスト計測および表示使用するメソッド提供します。このクラス継承できません。

TextRenderer データ型公開されるメンバを以下の表に示します


パブリック メソッドパブリック メソッド
プロテクト メソッドプロテクト メソッド
参照参照

関連項目

TextRenderer クラス
System.Windows.Forms 名前空間



英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  
  •  TextRendererのページへのリンク

辞書ショートカット

すべての辞書の索引

「TextRenderer」の関連用語

1
TextRenderer.DrawText メソッド .NET Framework クラス ライブラリ リファレンス
76% |||||

2
TextRenderer クラス .NET Framework クラス ライブラリ リファレンス
76% |||||

3
TextRenderer.MeasureText メソッド .NET Framework クラス ライブラリ リファレンス
72% |||||

4
ControlPaint.DrawStringDisabled メソッド .NET Framework クラス ライブラリ リファレンス
34% |||||

5
TextRenderer メンバ .NET Framework クラス ライブラリ リファレンス
34% |||||

6
Graphics.MeasureString メソッド .NET Framework クラス ライブラリ リファレンス
16% |||||

7
TextRenderer メソッド .NET Framework クラス ライブラリ リファレンス
16% |||||

8
Graphics.DrawString メソッド .NET Framework クラス ライブラリ リファレンス
14% |||||

9
TextFormatFlags 列挙体 .NET Framework クラス ライブラリ リファレンス
14% |||||

10
DataGridViewCell.BorderWidths メソッド .NET Framework クラス ライブラリ リファレンス
12% |||||

検索ランキング

   

英語⇒日本語
日本語⇒英語
   



TextRendererのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2025 Microsoft.All rights reserved.

©2025 GRAS Group, Inc.RSS