ScrollPattern.ScrollPatternInformation.VerticalViewSize Property
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.
Gets the current vertical view size.
public:
property double VerticalViewSize { double get(); };
public double VerticalViewSize { get; }
member this.VerticalViewSize : double
Public ReadOnly Property VerticalViewSize As Double
Property Value
The vertical size of the viewable region as a percentage of the total content area within the UI Automation element. The default value is 100.0.
Examples
In the following example, a ScrollPattern object obtained from a target control is passed into a function that retrieves the current vertical and horizontal sizes of the viewable region as percentages of the total content area.
///--------------------------------------------------------------------
/// <summary>
/// Obtains the current vertical and horizontal sizes of the viewable
/// region as percentages of the total content area.
/// </summary>
/// <param name="scrollPattern">
/// The ScrollPattern control pattern obtained from the
/// element of interest.
/// </param>
/// <returns>
/// The horizontal and vertical view sizes.
/// </returns>
///--------------------------------------------------------------------
private double[] GetViewSizes(ScrollPattern scrollPattern)
{
if (scrollPattern == null)
{
throw new ArgumentNullException(
"ScrollPattern argument cannot be null.");
}
double[] viewSizes = new double[2];
viewSizes[0] =
scrollPattern.Current.HorizontalViewSize;
viewSizes[1] =
scrollPattern.Current.VerticalViewSize;
return viewSizes;
}
'''--------------------------------------------------------------------
''' <summary>
''' Obtains the current vertical and horizontal sizes of the viewable
''' region as percentages of the total content area.
''' </summary>
''' <param name="scrollPattern">
''' The ScrollPattern control pattern obtained from the
''' element of interest.
''' </param>
''' <returns>
''' The horizontal and vertical view sizes.
''' </returns>
'''--------------------------------------------------------------------
Private Overloads Function GetViewSizes( _
ByVal scrollPattern As ScrollPattern) As Double()
If scrollPattern Is Nothing Then
Throw New ArgumentNullException( _
"ScrollPattern argument cannot be null.")
End If
Dim viewSizes(1) As Double
viewSizes(0) = scrollPattern.Current.HorizontalViewSize
viewSizes(1) = scrollPattern.Current.VerticalViewSize
Return viewSizes
End Function 'GetViewSizes
Applies to
GitHub에서 Microsoft와 공동 작업
이 콘텐츠의 원본은 GitHub에서 찾을 수 있으며, 여기서 문제와 끌어오기 요청을 만들고 검토할 수도 있습니다. 자세한 내용은 참여자 가이드를 참조하세요.
.NET