StringFormat.HotkeyPrefix プロパティとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > StringFormat.HotkeyPrefix プロパティの意味・解説 

StringFormat.HotkeyPrefix プロパティ

この StringFormat オブジェクトの HotkeyPrefix オブジェクト取得または設定します

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

Public Property HotkeyPrefix As
 HotkeyPrefix
Dim instance As StringFormat
Dim value As HotkeyPrefix

value = instance.HotkeyPrefix

instance.HotkeyPrefix = value
public HotkeyPrefix HotkeyPrefix { get; set;
 }
public:
property HotkeyPrefix HotkeyPrefix {
    HotkeyPrefix get ();
    void set (HotkeyPrefix value);
}
/** @property */
public HotkeyPrefix get_HotkeyPrefix ()

/** @property */
public void set_HotkeyPrefix (HotkeyPrefix
 value)
public function get HotkeyPrefix
 () : HotkeyPrefix

public function set HotkeyPrefix
 (value : HotkeyPrefix)

プロパティ
StringFormat オブジェクトHotkeyPrefix オブジェクト

解説解説
使用例使用例

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
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照


このページでは「.NET Framework クラス ライブラリ リファレンス」からStringFormat.HotkeyPrefix プロパティを検索した結果を表示しています。
Weblioに収録されているすべての辞書からStringFormat.HotkeyPrefix プロパティを検索する場合は、下記のリンクをクリックしてください。
 全ての辞書からStringFormat.HotkeyPrefix プロパティ を検索

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

辞書ショートカット

すべての辞書の索引

StringFormat.HotkeyPrefix プロパティのお隣キーワード
検索ランキング

   

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



StringFormat.HotkeyPrefix プロパティのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

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

©2025 GRAS Group, Inc.RSS