ScrollBar.LargeChange ScrollBar.LargeChange ScrollBar.LargeChange ScrollBar.LargeChange Property

定義

取得または加算または減算される値を設定、Valueプロパティのスクロール ボックスがある場合は、大規模な距離を移動します。Gets or sets a value to be added to or subtracted from the Value property when the scroll box is moved a large distance.

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

プロパティ値

数値を指定します。A numeric value. 既定値は 10 です。The default value is 10.

例外

割り当てられた値が、0 未満です。The assigned value is less than 0.

次の例で作成した、Formを追加しました、PictureBoxForm、水平方向の追加とHScrollBarと垂直方向VScrollBarPictureBoxします。The following example assumes that you have created a Form, added a PictureBox to the Form, and added a horizontal HScrollBar and a vertical VScrollBar to the PictureBox. このコード例が示されている例の一部、ScrollBarクラスの概要。This code example is part of a larger example provided for the ScrollBar class overview.

この例で、LargeChangeのサイズを基準とプロパティを設定、PictureBoxします。In this example, the LargeChange property is set relative to the size of the PictureBox.

参照を追加する必要があります、System.DrawingSystem.Windows.Forms名前空間をこの例を実行します。You must add references to the System.Drawing and System.Windows.Forms namespaces to run this example.

注意

Visual Studio でこの例を実行する方法については、次を参照してください。方法。Visual Studio を使用して、完全な Windows フォームのコードの例をコンパイルしてします。For instructions about how to run this example in Visual Studio, see How to: Compile and Run a Complete Windows Forms Code Example Using Visual Studio.

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プロパティ。When the user clicks in the scroll bar track on either side of the scroll box, the Value property changes according to the value set in the LargeChange property.

注意

ときに、PAGEUP キーを押すまたは PAGEDOWN キーのスクロール ボックスが移動できるように、キーを押すイベントを処理することができます。You can handle key press events so that when the user presses the PAGE UP or PAGE DOWN key the scroll box moves.

ユーザー インターフェイスのガイドラインを提示する、SmallChangeLargeChange見えない部分を含む合計サイズが、ユーザーに表示されるビューのサイズを基準とプロパティが設定されます。User interface guidelines suggest that the SmallChange and LargeChange properties are set relative to the size of the view that the user sees, not to the total size including the unseen part. たとえば、大きなイメージを表示するスクロール バーの画像ボックスがある場合、SmallChangeLargeChangeプロパティは、相対的なは、イメージのサイズではなく、ピクチャ ボックスのサイズに設定する必要があります。For example, if you have a picture box with scroll bars displaying a large image, the SmallChange and LargeChange properties should be set relative to the size of the picture box, not to the size of the image.

適用対象

こちらもご覧ください