Shape.Focused Property

Gets a value indicating whether a line or shape control currently has the input focus.

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

Syntax

'Declaração
<BrowsableAttribute(False)> _
Public Overridable ReadOnly Property Focused As Boolean
    Get
[BrowsableAttribute(false)]
public virtual bool Focused { get; }
[BrowsableAttribute(false)]
public:
virtual property bool Focused {
    bool get ();
}
[<BrowsableAttribute(false)>]
abstract Focused : bool
[<BrowsableAttribute(false)>]
override Focused : bool
function get Focused () : boolean

Property Value

Type: System.Boolean
true if the control currently has the input focus; otherwise, false.

Remarks

For LineShape, OvalShape, and RectangleShape controls, the value of the Focused property is the same as the ContainsFocus property.

To give a control the input focus, use the Focus or Select methods.

Examples

The following example reports whether the specified Shape currently has the input focus.

Public Sub ReportFocus(ByVal shape As Microsoft.VisualBasic.PowerPacks.Shape)
    ' Determine whether the Shape has focus.
    If shape.ContainsFocus Then
        MsgBox(shape.Name & " has focus.")
    End If
End Sub
public void ReportFocus(Microsoft.VisualBasic.PowerPacks.Shape shape)
{
    // Determine whether the Shape has focus.
    if (shape.ContainsFocus)
    {
        MessageBox.Show(shape.Name + " has focus.");
    }
}

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