[]
Sets the ScrollLocation and determines whether use animation when change ScrollLocation.
public void SetScrollLocation(Point scrollLocation, bool useAnimation = false)
Type | Name | Description |
---|---|---|
Point | scrollLocation | The scroll location. |
bool | useAnimation | true to use animation; otherwise, false. |
The following code example shows how to use this method.
This code example is part of a larger example provided for the AnimationStartingEventArgs class.
class GcZoomAnimationDemo : Form
{
private Button _scrollRightBtn = new Button();
private GcZoom _gcZoom1 = new GcZoom();
public GcZoomAnimationDemo()
{
InitializeComponent();
_gcZoom1.Target = this;
_scrollRightBtn.Click += _scrollRightBtn_Click;
}
void _scrollRightBtn_Click(object sender, EventArgs e)
{
_gcZoom1.SetScrollLocation(new Point(-1000, 0), true);
}
private void InitializeComponent()
{
this._scrollRightBtn.Location = new System.Drawing.Point(12, 100);
this._scrollRightBtn.Size = new System.Drawing.Size(260, 30);
this._scrollRightBtn.Text = "Scroll Right";
this.Controls.Add(this._scrollRightBtn);
}
}
Class GcZoomAnimationDemo
Inherits Form
Private _scrollRightBtn As New Button()
Private _gcZoom1 As New GcZoom()
Public Sub New()
InitializeComponent()
_gcZoom1.Target = Me
AddHandler _scrollRightBtn.Click, AddressOf _scrollRightBtn_Click
End Sub
Private Sub _scrollRightBtn_Click(sender As Object, e As EventArgs)
_gcZoom1.SetScrollLocation(New Point(-1000, 0), True)
End Sub
Private Sub InitializeComponent()
Me._scrollRightBtn.Location = New System.Drawing.Point(12, 100)
Me._scrollRightBtn.Size = New System.Drawing.Size(260, 30)
Me._scrollRightBtn.Text = "Scroll Right"
Me.Controls.Add(Me._scrollRightBtn)
End Sub
End Class