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

See Also

Reference

Shape Class

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)

Introduction to the Line and Shape Controls (Visual Studio)