Shape.ModifierKeys 屬性
取得表示哪個輔助按鍵 (SHIFT、CTRL 和 ALT) 是處於按下狀態的值。
命名空間: Microsoft.VisualBasic.PowerPacks
組件: Microsoft.VisualBasic.PowerPacks.Vs (在 Microsoft.VisualBasic.PowerPacks.Vs.dll 中)
語法
'宣告
<BrowsableAttribute(False)> _
Public Shared ReadOnly Property ModifierKeys As Keys
[BrowsableAttribute(false)]
public static Keys ModifierKeys { get; }
[BrowsableAttribute(false)]
public:
static property Keys ModifierKeys {
Keys get ();
}
[<BrowsableAttribute(false)>]
static member ModifierKeys : Keys with get
static function get ModifierKeys () : Keys
屬性值
類型:Keys
Keys 值的位元 (Bitwise) 組合。預設為 None。
範例
按一下圖形時,按下 CTRL 鍵時,下列範例會隱藏圖形。 此範例中您需要RectangleShape名 RectangleShape1 為表單上。
Private Sub RectangleShape1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RectangleShape1.Click
If Shape.ModifierKeys = Keys.Control Then
CType(sender, Shape).Hide()
End If
End Sub
private void rectangleShape1_Click(System.Object sender, System.EventArgs e)
{
if (Shape.ModifierKeys == Keys.Control)
{
((Shape)sender).Hide();
}
}
.NET Framework 安全性
- 完全信任立即呼叫者。這個成員無法供部分信任的程式碼使用。如需詳細資訊,請參閱從部分受信任程式碼使用程式庫。
請參閱
參考
Microsoft.VisualBasic.PowerPacks 命名空間
其他資源
如何:使用 LineShape 控制項繪製線條 (Visual Studio)