Shape.CanSelect Property

Gets a value indicating whether a line or shape control can be selected.

Namespace:  Microsoft.VisualBasic.PowerPacks
Assembly:  Microsoft.VisualBasic.PowerPacks.Vs (in Microsoft.VisualBasic.PowerPacks.Vs.dll)

Syntax

'Declaration
<BrowsableAttribute(False)> _
Public ReadOnly Property CanSelect As Boolean
[BrowsableAttribute(false)]
public bool CanSelect { get; }
[BrowsableAttribute(false)]
public:
property bool CanSelect {
    bool get ();
}
[<BrowsableAttribute(false)>]
member CanSelect : bool with get
function get CanSelect () : boolean

Property Value

Type: System.Boolean
true if the control can be selected; otherwise, false. The default is true.

Remarks

This property returns true if the control itself is visible and enabled, and all its parent controls are visible and enabled.

To prevent an individual control from being selected, set its Enabled property to false.

Examples

The following example selects the specified Shape, if it can be selected.

Public Sub SelectShape(ByVal shape As Microsoft.VisualBasic.PowerPacks.Shape)
    ' Select the control, if it can be selected. 
    If shape.CanSelect Then
        shape.Select()
    End If 
End Sub
public void SelectShape(Microsoft.VisualBasic.PowerPacks.Shape shape)
{
    // Select the control, if it can be selected. 
    if (shape.CanSelect)
    {
        shape.Select();
    }
}

.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)