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

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

Control.ModifierKeys プロパティ

どの修飾子キー (ShiftCtrl、および Alt) が押された状態であるかを示す値を取得します

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

Public Shared ReadOnly Property
 ModifierKeys As Keys
Dim value As Keys

value = Control.ModifierKeys
public static Keys ModifierKeys { get;
 }
public:
static property Keys ModifierKeys {
    Keys get ();
}
/** @property */
public static Keys get_ModifierKeys ()

プロパティ
Keys 値のビットごとの組み合わせ既定値は None です。

使用例使用例

ボタンクリックされたときに Ctrl キー押されている場合次のコード例ではそのボタンが非表示なります。この例では、button1 という ButtonForm 上に存在している必要があります

Private Sub button1_Click(sender As
 Object, _
  e As EventArgs) Handles button1.Click
   ' If the CTRL key is pressed when the 
   ' control is clicked, hide the control. 
   If Control.ModifierKeys = Keys.Control Then
      CType(sender, Control).Hide()
   End If
End Sub
private void button1_Click(object sender, System.EventArgs
 e)
{
   /* If the CTRL key is pressed when the 
      * control is clicked, hide the control. */
   if(Control.ModifierKeys == Keys.Control)
   {
      ((Control)sender).Hide();
   }
}
private:
   void button1_Click( Object^ sender, System::EventArgs^ /*e*/
 )
   {
      /* If the CTRL key is pressed when the
         * control is clicked, hide the control. */
      if ( Control::ModifierKeys == Keys::Control )
      {
         (dynamic_cast<Control^>(sender))->Hide();
      }
   }
private void button1_Click(Object sender, System.EventArgs
 e)
{
    /* If the CTRL key is pressed when the 
       control is clicked, hide the control. 
     */
    if (Control.get_ModifierKeys().Equals(Keys.Control)) {
        ((Control)sender).Hide();
    }
} //button1_Click
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照


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

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

辞書ショートカット

すべての辞書の索引

「Control.ModifierKeys プロパティ」の関連用語

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

   

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



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

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

©2025 GRAS Group, Inc.RSS