ScrollBar.LargeChange 속성

정의

스크롤 상자를 많이 이동시킬 때 Value 속성에서 증가되거나 감소되는 값을 가져오거나 설정합니다.

public:
 property int LargeChange { int get(); void set(int value); };
public int LargeChange { get; set; }
member this.LargeChange : int with get, set
Public Property LargeChange As Integer

속성 값

Int32

숫자 값입니다. 기본값은 10입니다.

예외

할당된 값이 0보다 작은 경우

예제

다음 예제에서는 사용자가 만든 Form것으로 가정, 에 추가 하 FormPictureBox 고 가로 HScrollBar 및 세 VScrollBar 로를 PictureBox추가 합니다. 이 코드 예제는에 대해 제공 된 큰 예제의 일부는 ScrollBar 클래스 개요입니다.

이 예제에서 LargeChange 속성은 크기를 기준으로 설정됩니다 PictureBox.

이 예제를 실행하려면 네임스페이 System.Drawing System.Windows.Forms 스와 네임스페이스에 대한 참조를 추가해야 합니다.

참고

Visual Studio 이 예제를 실행하는 방법에 대한 지침은 방법: Visual Studio 사용하여 전체 Windows Forms 코드 예제 컴파일 및 실행을 참조하세요.

public void SetScrollBarValues()
{
    //Set the following scrollbar properties:

    //Minimum: Set to 0

    //SmallChange and LargeChange: Per UI guidelines, these must be set
    //    relative to the size of the view that the user sees, not to
    //    the total size including the unseen part.  In this example,
    //    these must be set relative to the picture box, not to the image.

    //Maximum: Calculate in steps:
    //Step 1: The maximum to scroll is the size of the unseen part.
    //Step 2: Add the size of visible scrollbars if necessary.
    //Step 3: Add an adjustment factor of ScrollBar.LargeChange.

    //Configure the horizontal scrollbar
    //---------------------------------------------
    if (this.hScrollBar1.Visible)
    {
        this.hScrollBar1.Minimum = 0;
        this.hScrollBar1.SmallChange = this.pictureBox1.Width / 20;
        this.hScrollBar1.LargeChange = this.pictureBox1.Width / 10;

        this.hScrollBar1.Maximum = this.pictureBox1.Image.Size.Width - pictureBox1.ClientSize.Width;  //step 1

        if (this.vScrollBar1.Visible) //step 2
        {
            this.hScrollBar1.Maximum += this.vScrollBar1.Width;
        }

        this.hScrollBar1.Maximum += this.hScrollBar1.LargeChange; //step 3
    }

    //Configure the vertical scrollbar
    //---------------------------------------------
    if (this.vScrollBar1.Visible)
    {
        this.vScrollBar1.Minimum = 0;
        this.vScrollBar1.SmallChange = this.pictureBox1.Height / 20;
        this.vScrollBar1.LargeChange = this.pictureBox1.Height / 10;

        this.vScrollBar1.Maximum = this.pictureBox1.Image.Size.Height - pictureBox1.ClientSize.Height; //step 1

        if (this.hScrollBar1.Visible) //step 2
        {
            this.vScrollBar1.Maximum += this.hScrollBar1.Height;
        }

        this.vScrollBar1.Maximum += this.vScrollBar1.LargeChange; //step 3
    }
}
Public Sub SetScrollBarValues()

    'Set the following scrollbar properties:

    'Minimum: Set to 0

    'SmallChange and LargeChange: Per UI guidelines, these must be set
    '    relative to the size of the view that the user sees, not to
    '    the total size including the unseen part.  In this example,
    '    these must be set relative to the picture box, not to the image.

    'Maximum: Calculate in steps:
    'Step 1: The maximum to scroll is the size of the unseen part.
    'Step 2: Add the size of visible scrollbars if necessary.
    'Step 3: Add an adjustment factor of ScrollBar.LargeChange.


    'Configure the horizontal scrollbar
    '---------------------------------------------
    If (Me.hScrollBar1.Visible) Then

        Me.hScrollBar1.Minimum = 0
        Me.hScrollBar1.SmallChange = CInt(Me.pictureBox1.Width / 20)
        Me.hScrollBar1.LargeChange = CInt(Me.pictureBox1.Width / 10)

        Me.hScrollBar1.Maximum = Me.pictureBox1.Image.Size.Width - pictureBox1.ClientSize.Width  'step 1

        If (Me.vScrollBar1.Visible) Then 'step 2

            Me.hScrollBar1.Maximum += Me.vScrollBar1.Width
        End If

        Me.hScrollBar1.Maximum += Me.hScrollBar1.LargeChange 'step 3
    End If

    'Configure the vertical scrollbar
    '---------------------------------------------
    If (Me.vScrollBar1.Visible) Then

        Me.vScrollBar1.Minimum = 0
        Me.vScrollBar1.SmallChange = CInt(Me.pictureBox1.Height / 20)
        Me.vScrollBar1.LargeChange = CInt(Me.pictureBox1.Height / 10)

        Me.vScrollBar1.Maximum = Me.pictureBox1.Image.Size.Height - pictureBox1.ClientSize.Height 'step 1

        If (Me.hScrollBar1.Visible) Then 'step 2

            Me.vScrollBar1.Maximum += Me.hScrollBar1.Height
        End If

        Me.vScrollBar1.Maximum += Me.vScrollBar1.LargeChange 'step 3
    End If
 End Sub

설명

사용자가 스크롤 상자 Value 의 양쪽에 있는 스크롤 막대 트랙을 클릭하면 속성에 설정된 값에 따라 속성이 LargeChange 변경됩니다.

참고

사용자가 PAGE UP 또는 PAGE DOWN 키를 누르면 스크롤 상자가 이동되도록 키 누름 이벤트를 처리할 수 있습니다.

사용자 인터페이스 지침에 SmallChange 따르면 보이지 않는 부분을 포함한 총 크기가 아니라 사용자가 보는 보기의 크기를 기준으로 속성과 LargeChange 속성이 설정됩니다. 예를 들어 큰 이미지를 표시하는 스크롤 막대가 있는 그림 상자가 있는 경우 이미지 SmallChange 크기가 아니라 그림 상자의 크기를 기준으로 속성과 LargeChange 속성을 설정해야 합니다.

적용 대상

추가 정보