Shape.ModifierKeys Property
Gets a value indicating which of the modifier keys (SHIFT, CTRL, and ALT) is in a pressed state.
Namespace: Microsoft.VisualBasic.PowerPacks
Assembly: Microsoft.VisualBasic.PowerPacks.Vs (in Microsoft.VisualBasic.PowerPacks.Vs.dll)
Syntax
'Declaration
<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
Property Value
Type: System.Windows.Forms.Keys
A bitwise combination of the Keys values. The default is None.
Examples
The following example hides a shape when the CTRL key is pressed when the shape is clicked. This example requires that you have a RectangleShape named RectangleShape1 on a form.
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 Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.
See Also
Reference
Microsoft.VisualBasic.PowerPacks Namespace
Other Resources
How to: Draw Lines with the LineShape Control (Visual Studio)
How to: Draw Shapes with the OvalShape and RectangleShape Controls (Visual Studio)