AutomationElement.BoundingRectangleProperty Pole
Definicja
Ważne
Niektóre informacje odnoszą się do produktu w wersji wstępnej, który może zostać znacząco zmodyfikowany przed wydaniem. Firma Microsoft nie udziela żadnych gwarancji, jawnych lub domniemanych, w odniesieniu do informacji podanych w tym miejscu.
BoundingRectangle Identyfikuje 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 dla właściwości, NotSupported ma zostać zwrócona 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żyć równoważnego identyfikatora w AutomationElementIdentifiers.
Tę właściwość można również pobrać z Current właściwości lub Cached .
Prostokąty ograniczenia mają typ 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óre 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.