Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

Shape.ContainsFocus 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)
public bool ContainsFocus { get; }

Property Value

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

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

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

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

public void ReportFocus(Microsoft.VisualBasic.PowerPacks.Shape shape)
    // Determine whether the Shape has focus. 
    if (shape.ContainsFocus)
        MessageBox.Show(shape.Name + " has focus.");
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
© 2014 Microsoft. All rights reserved.