SystemBrushes クラスとは? わかりやすく解説

SystemBrushes クラス

SystemBrushes クラスの各プロパティは、Windows表示要素の色を表す SolidBrush です。

名前空間: System.Drawing
アセンブリ: System.Drawing (system.drawing.dll 内)
構文構文

Public NotInheritable Class
 SystemBrushes
Dim instance As SystemBrushes
public sealed class SystemBrushes
public ref class SystemBrushes sealed
public final class SystemBrushes
public final class SystemBrushes
使用例使用例

HotkeyPrefix プロパティ使用してショートカット キー設定する方法次のコード例示します。この例では、FromSystemColor メソッド使用方法示します。この例を実行するには、コードフォーム貼り付けてフォームPaint イベント処理し、PaintEventArgs の e渡して次のメソッド呼び出します。

Private Sub ShowHotKey(ByVal
 e As PaintEventArgs)

    ' Declare the string with keyboard shortcut.
    Dim text As String =
 "&Click Here"

    ' Declare a new StringFormat.
    Dim format As New StringFormat

    ' Set the HotkeyPrefix property.
    format.HotkeyPrefix = System.Drawing.Text.HotkeyPrefix.Show

    ' Draw the string.
    Dim theBrush As Brush = _
        SystemBrushes.FromSystemColor(SystemColors.Highlight)
    e.Graphics.DrawString(text, Me.Font, theBrush, 30, 40, format)
End Sub
private void ShowHotKey(PaintEventArgs e)
{

    // Declare the string with a keyboard shortcut.
    string text = "&Click Here";

    // Declare a new StringFormat.
    StringFormat format = new StringFormat();

    // Set the HotkeyPrefix property.
    format.HotkeyPrefix = System.Drawing.Text.HotkeyPrefix.Show;

    // Draw the string.
    Brush theBrush = 
        SystemBrushes.FromSystemColor(SystemColors.Highlight);

    e.Graphics.DrawString(text, this.Font, theBrush, 30, 40, format);
}
private:
   void ShowHotKey( PaintEventArgs^ e )
   {
      // Declare the string with a keyboard shortcut.
      String^ text = "&Click Here";

      // Declare a new StringFormat.
      StringFormat^ format = gcnew StringFormat;

      // Set the HotkeyPrefix property.
      format->HotkeyPrefix = System::Drawing::Text::HotkeyPrefix::Show;

      // Draw the string.
      Brush^ theBrush = SystemBrushes::FromSystemColor( SystemColors::Highlight );
      e->Graphics->DrawString( text, this->Font, theBrush,
 30, 40, format );
   }
private void ShowHotKey(PaintEventArgs e)
{
    // Declare the string with a keyboard shortcut.
    String text = "&Click Here";

    // Declare a new StringFormat.
    StringFormat format = new StringFormat();

    // Set the HotkeyPrefix property.
    format.set_HotkeyPrefix(System.Drawing.Text.HotkeyPrefix.Show);

    // Draw the string.
    Brush theBrush = SystemBrushes.FromSystemColor(
        SystemColors.get_Highlight());

    e.get_Graphics().DrawString(text, this.get_Font(), theBrush,
 30, 40, 
        format);
} //ShowHotKey
継承階層継承階層
System.Object
  System.Drawing.SystemBrushes
スレッド セーフスレッド セーフ
この型の public static (Visual Basic では Shared) メンバはすべて、スレッド セーフです。インスタンス メンバ場合は、スレッド セーフであるとは限りません。
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照



英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「SystemBrushes クラス」の関連用語

SystemBrushes クラスのお隣キーワード
検索ランキング

   

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



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

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

©2025 GRAS Group, Inc.RSS