Share via


AutomationElement.IsOffscreenProperty Campo

Definizione

Identifica la IsOffscreen proprietà , che indica se l'elemento dell'interfaccia utente è visibile sullo schermo.

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

Valore del campo

Esempio

Nell'esempio seguente viene recuperato il valore corrente della proprietà . Il valore predefinito viene restituito se l'elemento non ne fornisce uno.

bool isControlOffscreen = (bool)
   autoElement.GetCurrentPropertyValue(AutomationElement.IsOffscreenProperty);
Dim isControlOffscreen As Boolean = _
    CBool(autoElement.GetCurrentPropertyValue(AutomationElement.IsOffscreenProperty))

Nell'esempio seguente viene recuperato il valore corrente della proprietà , ma viene specificato che se l'elemento stesso non fornisce un valore per la proprietà , NotSupported deve essere restituito anziché un valore predefinito.

bool isControlOffscreen1;
object isOffscreenNoDefault =
    autoElement.GetCurrentPropertyValue(AutomationElement.IsOffscreenProperty, true);
if (isOffscreenNoDefault == AutomationElement.NotSupported)
{
    // TODO Handle the case where you do not wish to proceed using the default value.
}
else
{
    isControlOffscreen1 = (bool)isOffscreenNoDefault;
}
Dim isControlOffscreen1 As Boolean
Dim isOffscreenNoDefault As Object = autoElement.GetCurrentPropertyValue(AutomationElement.IsOffscreenProperty, True)
If isOffscreenNoDefault Is AutomationElement.NotSupported Then
    ' TODO Handle the case where you do not wish to proceed using the default value.
Else
    isControlOffscreen1 = CBool(isOffscreenNoDefault)
End If

Commenti

Questo identificatore viene usato da Automazione interfaccia utente applicazioni client. Automazione interfaccia utente provider devono usare l'identificatore equivalente in AutomationElementIdentifiers.

Questa proprietà può essere recuperata anche dalle Current proprietà o Cached .

Il valore restituito è di tipo Booleane il valore predefinito è false.

Per altre informazioni su quando questa proprietà è true, vedere IsOffscreen.

Si applica a

Vedi anche