LargeChange Property

Applies To

ScrollBar control.

Description

Specifies the amount of movement that occurs when the user clicks between the scroll box and scroll arrow.

Syntax

object.LargeChange [= Long]

The LargeChange property syntax has these parts:

Part

Description

object

Required. A valid object.

Long

Optional. An integer that specifies the amount of change to the Value property.


Remarks

The LargeChange property applies only to the ScrollBar. It does not apply to the scroll bars in other controls such as a TextBox or a drop-down ComboBox.

The value of LargeChange is the amount by which the ScrollBar's Value property changes when the user clicks the area between the scroll box and scroll arrow. The direction of the movement is always toward the place where the user clicks. For example, in a horizontal ScrollBar, clicking to the left of the scroll box moves the scroll box to the left. In a vertical ScrollBar, clicking above the scroll box moves the scroll box up.

LargeChange does not have units. Any integer is a valid setting for LargeChange. The recommended range of values is from –32,767 to +32,767, and the value must be between the values of the Max and Min properties of the ScrollBar.

See Also

Max, Min properties, SmallChange property.

Example

The following example demonstrates the LargeChange and SmallChange properties when used with a stand-alone ScrollBar. The user can set the LargeChange and SmallChange values to any integer in the range of 0 to 100. This example also uses the MaxLength property to restrict the number of characters entered for the LargeChange and SmallChange values.

To use this example, copy this sample code to the Declarations portion of a form. Make sure that the form contains:

  • A Label named Label1 and a TextBox named TextBox1.
  • A Label named Label2 and a TextBox named TextBox2.
  • A ScrollBar named ScrollBar1.
  • A Label named Label3.
    Dim TempNum As Integer
    
    Private Sub ScrollBar1_Change()
        Label3.Caption = ScrollBar1.Value
    End Sub
    
    Private Sub TextBox1_Change()
        If IsNumeric(TextBox1.Text) Then
            TempNum = CInt(TextBox1.Text)
            If TempNum >= 0 And TempNum <= 100 Then
                ScrollBar1.SmallChange = TempNum
            Else
                TextBox1.Text = ScrollBar1.SmallChange
            End If
        Else
            TextBox1.Text = ScrollBar1.SmallChange
        End If
    End Sub
    
    Private Sub TextBox2_Change()
        If IsNumeric(TextBox2.Text) Then
            TempNum = CInt(TextBox2.Text)
            If TempNum >= 0 And TempNum <= 100 Then
                ScrollBar1.LargeChange = TempNum
            Else
                TextBox2.Text = ScrollBar1.LargeChange
            End If
        Else
            TextBox2.Text = ScrollBar1.LargeChange
        End If
    End Sub
    
    Private Sub UserForm_Initialize()
        ScrollBar1.Min = -1000
        ScrollBar1.Max = 1000
        
        Label1.Caption = "SmallChange 0 to 100"
        ScrollBar1.SmallChange = 1
        TextBox1.Text = ScrollBar1.SmallChange
        TextBox1.MaxLength = 3
        
        Label2.Caption = "LargeChange 0 to 100"
        ScrollBar1.LargeChange = 100
        TextBox2.Text = ScrollBar1.LargeChange
        TextBox2.MaxLength = 3
        
        ScrollBar1.Value = 0
        Label3.Caption = ScrollBar1.Value
    End Sub