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)

[BrowsableAttribute(false)]
public bool CanSelect { get; }

Property Value

Type: System.Boolean

true if the control can be selected; otherwise, false. The default is true.

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.

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

public void SelectShape(Microsoft.VisualBasic.PowerPacks.Shape shape)
{
    // Select the control, if it can be selected.
    if (shape.CanSelect)
    {
        shape.Select();
    }
}
Return to top
Show: