AutomationElement.BoundingRectangleProperty Pole

Definicja

Identyfikuje BoundingRectangle właściwość .

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 

Wartość pola

Przykłady

Poniższy przykład pobiera bieżącą wartość właściwości . Wartość domyślna jest zwracana, jeśli element go nie podaje.

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)

Poniższy przykład pobiera bieżącą wartość właściwości, ale określa, że jeśli sam element nie podaje wartości właściwości, NotSupported ma zostać zwrócony zamiast wartości domyślnej.

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

Uwagi

Ten identyfikator jest używany przez aplikacje klienckie automatyzacja interfejsu użytkownika. automatyzacja interfejsu użytkownika dostawcy powinni używać równoważnego identyfikatora w elemencie AutomationElementIdentifiers.

Tę właściwość można również pobrać z Current właściwości lub Cached .

Powiązane prostokąty są typu Rect. Zwrócony prostokąt znajduje się we współrzędnych ekranu fizycznego. Wartość domyślna to Empty. Empty jest zwracany, jeśli element nie wyświetla obecnie interfejsu użytkownika.

Zwrócony prostokąt może zawierać punkty, których nie można klikać. Wystąpienia, w których może się to zdarzyć, obejmują, gdy element interfejsu użytkownika ma nieregularny kształt lub region możliwy do kliknięcia lub jest zasłonięty przez inne elementy interfejsu użytkownika.

Dotyczy

Zobacz też