AutomationElement.BoundingRectangleProperty Campo

Definición

Identifica la BoundingRectangle propiedad .

public: static initonly System::Windows::Automation::AutomationProperty ^ BoundingRectangleProperty;
public static readonly System.Windows.Automation.AutomationProperty BoundingRectangleProperty;
 staticval mutable BoundingRectangleProperty : System.Windows.Automation.AutomationProperty
Public Shared ReadOnly BoundingRectangleProperty As AutomationProperty 

Valor de campo

Ejemplos

En el ejemplo siguiente se recupera el valor actual de la propiedad . El valor predeterminado se devuelve si el elemento no proporciona uno.

System.Windows.Rect boundingRect = (System.Windows.Rect)
    autoElement.GetCurrentPropertyValue(AutomationElement.BoundingRectangleProperty);
Dim boundingRect As System.Windows.Rect = CType(autoElement.GetCurrentPropertyValue(AutomationElement.BoundingRectangleProperty), System.Windows.Rect)

En el ejemplo siguiente se recupera el valor actual de la propiedad , pero se especifica que si el propio elemento no proporciona un valor para la propiedad , NotSupported se devolverá en lugar de un valor predeterminado.

System.Windows.Rect boundingRect1;
object boundingRectNoDefault =
    autoElement.GetCurrentPropertyValue(AutomationElement.BoundingRectangleProperty, true);
if (boundingRectNoDefault == AutomationElement.NotSupported)
{
    // TODO Handle the case where you do not wish to proceed using the default value.
}
else
{
    boundingRect1 = (System.Windows.Rect)boundingRectNoDefault;
}
Dim boundingRect1 As System.Windows.Rect
Dim boundingRectNoDefault As Object = autoElement.GetCurrentPropertyValue(AutomationElement.BoundingRectangleProperty, True)
If boundingRectNoDefault Is AutomationElement.NotSupported Then
    ' TODO Handle the case where you do not wish to proceed using the default value.
Else
    boundingRect1 = DirectCast(boundingRectNoDefault, System.Windows.Rect)
End If

Comentarios

Las aplicaciones cliente usan este identificador Automatización de la interfaz de usuario. Automatización de la interfaz de usuario proveedores deben usar el identificador equivalente en AutomationElementIdentifiers.

Esta propiedad también se puede recuperar de las Current propiedades o Cached .

Los rectángulos delimitadores son de tipo Rect. El rectángulo devuelto está en coordenadas de pantalla físicas. El valor por defecto es Empty. Empty se devuelve si el elemento no muestra actualmente una interfaz de usuario (UI).

El rectángulo devuelto puede contener puntos que no se pueden hacer clic. Las instancias en las que esto puede ocurrir incluyen cuando el elemento de la interfaz de usuario tiene una forma irregular o una región en la que se puede hacer clic, o se ocultan por otros elementos de la interfaz de usuario.

Se aplica a

Consulte también