TextBoxBase.ViewportWidth 속성


스크롤 가능한 콘텐츠 영역의 가로 크기를 가져옵니다.Gets the horizontal size of the scrollable content area.

 property double ViewportWidth { double get(); };
public double ViewportWidth { get; }
member this.ViewportWidth : double
Public ReadOnly Property ViewportWidth As Double

속성 값

스크롤할 수 있는 콘텐츠 영역의 가로 크기를 디바이스 독립적 단위(단위당 1/96인치)device-independent units (1/96th inch per unit) 단위로 지정하는 부동 소수점 값입니다.A floating-point value that specifies the horizontal size of the scrollable content area, in 디바이스 독립적 단위(단위당 1/96인치)device-independent units (1/96th inch per unit).

텍스트 편집 컨트롤이 스크롤을 지원하도록 구성되지 않은 경우 이 속성의 값은 0.0입니다.The value of this property is 0.0 if the text editing control is not configured to support scrolling.

이 속성에는 기본값이 없습니다.This property has no default value.


다음 예제에서는 ViewportWidth 속성의 값을 읽는 방법을 보여 줍니다.The following example demonstrates how to read the value of the ViewportWidth property.

private void initValues(object sender, EventArgs e)
    myTB1.Text= "ExtentHeight is currently " + myTextBox.ExtentHeight.ToString();
    myTB2.Text= "ExtentWidth is currently " + myTextBox.ExtentWidth.ToString();
    myTB3.Text= "HorizontalOffset is currently " + myTextBox.HorizontalOffset.ToString();
    myTB4.Text= "VerticalOffset is currently " + myTextBox.VerticalOffset.ToString();
    myTB5.Text = "ViewportHeight is currently " + myTextBox.ViewportHeight.ToString();
    myTB6.Text = "ViewportWidth is currently " + myTextBox.ViewportWidth.ToString();
    radiobtn1.IsChecked = true;
Private Sub initValues(ByVal sender As Object, ByVal e As EventArgs)
    myTB1.Text = "ExtentHeight is currently " + myTextBox.ExtentHeight.ToString()
    myTB2.Text = "ExtentWidth is currently " + myTextBox.ExtentWidth.ToString()
    myTB3.Text = "HorizontalOffset is currently " + myTextBox.HorizontalOffset.ToString()
    myTB4.Text = "VerticalOffset is currently " + myTextBox.VerticalOffset.ToString()
    myTB5.Text = "ViewportHeight is currently " + myTextBox.ViewportHeight.ToString()
    myTB6.Text = "ViewportWidth is currently " + myTextBox.ViewportWidth.ToString()
    radiobtn1.IsChecked = True

적용 대상

추가 정보