ScrollPattern.HorizontallyScrollableProperty Field
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Identifies the HorizontallyScrollable property.
public: static initonly System::Windows::Automation::AutomationProperty ^ HorizontallyScrollableProperty;
public static readonly System.Windows.Automation.AutomationProperty HorizontallyScrollableProperty;
staticval mutable HorizontallyScrollableProperty : System.Windows.Automation.AutomationProperty
Public Shared ReadOnly HorizontallyScrollableProperty As AutomationProperty
Field Value
Examples
In the following example, a root element is passed to a function that returns a collection of UI Automation elements that are descendants of the root and satisfy a set of property conditions.
///--------------------------------------------------------------------
/// <summary>
/// Finds all automation elements that satisfy
/// the specified condition(s).
/// </summary>
/// <param name="targetApp">
/// The automation element from which to start searching.
/// </param>
/// <returns>
/// A collection of automation elements satisfying
/// the specified condition(s).
/// </returns>
///--------------------------------------------------------------------
private AutomationElementCollection FindAutomationElement(
AutomationElement targetApp)
{
if (targetApp == null)
{
throw new ArgumentException("Root element cannot be null.");
}
PropertyCondition conditionSupportsScroll =
new PropertyCondition(
AutomationElement.IsScrollPatternAvailableProperty, true);
PropertyCondition conditionHorizontallyScrollable =
new PropertyCondition(
ScrollPattern.HorizontallyScrollableProperty, true);
PropertyCondition conditionVerticallyScrollable =
new PropertyCondition(
ScrollPattern.VerticallyScrollableProperty, true);
// Use any combination of the preceding conditions to
// find the control(s) of interest
Condition condition = new AndCondition(
conditionSupportsScroll,
conditionHorizontallyScrollable,
conditionVerticallyScrollable);
return targetApp.FindAll(TreeScope.Descendants, condition);
}
'''--------------------------------------------------------------------
''' <summary>
''' Finds all automation elements that satisfy
''' the specified condition(s).
''' </summary>
''' <param name="targetApp">
''' The automation element from which to start searching.
''' </param>
''' <returns>
''' A collection of automation elements satisfying
''' the specified condition(s).
''' </returns>
'''--------------------------------------------------------------------
Private Function FindAutomationElement( _
ByVal targetApp As AutomationElement) As AutomationElementCollection
If targetApp Is Nothing Then
Throw New ArgumentException("Root element cannot be null.")
End If
Dim conditionSupportsScroll As New PropertyCondition( _
AutomationElement.IsScrollPatternAvailableProperty, True)
Dim conditionHorizontallyScrollable As New PropertyCondition( _
ScrollPattern.HorizontallyScrollableProperty, True)
Dim conditionVerticallyScrollable As New PropertyCondition( _
ScrollPattern.VerticallyScrollableProperty, True)
' Use any combination of the preceding conditions to
' find the control(s) of interest
Dim condition As AndCondition = New AndCondition( _
conditionSupportsScroll, _
conditionHorizontallyScrollable, _
conditionVerticallyScrollable)
Return targetApp.FindAll(TreeScope.Descendants, condition)
End Function 'FindAutomationElement
Remarks
This identifier is used by UI Automation client applications. UI Automation providers should use the equivalent field in ScrollPatternIdentifiers.
Applies to
See also
GitHub에서 Microsoft와 공동 작업
이 콘텐츠의 원본은 GitHub에서 찾을 수 있으며, 여기서 문제와 끌어오기 요청을 만들고 검토할 수도 있습니다. 자세한 내용은 참여자 가이드를 참조하세요.
.NET