TouchToolKit for WinForms | ComponentOne
C1.Win.TouchToolKit Namespace / C1Zoom Class / ScrollLocation Property
Example

In This Topic
    ScrollLocation Property (C1Zoom)
    In This Topic
    Gets or sets the scroll location of the form.
    Syntax
    'Declaration
     
    
    Public Property ScrollLocation As Point
    public Point ScrollLocation {get; set;}

    Property Value

    A System.Drawing.Point value that represents the scroll location of the form in pixels.
    Remarks

    The ScrollLocation property represents the location of the visible portion of a the form. Use this property to change the portion of the control that is displayed.

    The System.Drawing.Point.X and System.Drawing.Point.Y coordinate values retrieved are negative if the control has scrolled away from its starting position (0,0). When you set this property, you must always assign positive System.Drawing.Point.X and System.Drawing.Point.Y values to set the scroll position relative to the starting position. For example, if you have a horizontal scroll bar and you set x and y to 200, you move the scroll 200 pixels to the right; if you then set x and y to 100, the scroll appears to jump the left by 100 pixels, because you are setting it 100 pixels away from the starting position. In the first case, ScrollLocation returns {-200, 0}; in the second case, it returns {-100,0}.

    If the set value bigger than scrollable maximum value, the ScrollLocation will adjust the value to maximum value automatically. And also, if the set value smaller than scrollable minimum value, the ScrollLocation will adjust the value to minimum value automatically.

    Example

    The following code example shows how to use this property.

    This code example is part of a larger example provided for the ScrollIndicatorMode property.

    See Also