Initializes a new instance of the ScrollEventArgs class.
[Visual Basic] Public Sub New( _ ByVal type As ScrollEventArgsType, _ ByVal newValue As Integer _ ) [C#] public ScrollEventArgs( ScrollEventArgsType type, int newValue ); [C++] public: ScrollEventArgs( ScrollEventArgsType type, int newValue ); [JScript] public function ScrollEventArgs( type : ScrollEventArgsType, newValue : int );
The System.WinForms.ScrollEventArgs.ScrollEventArgs specifies the type of scroll event that occurred and the new value of the scroll bar.
The following example creates an event handler for the System.WinForms.ScrollBar.Scroll event and displays the value of the scroll bar in a label every time the System.WinForms.ScrollEventArgs.Scroll event is raised. This code assumes that a Label and a VScrollBar have been instantiated on a form.
[Visual Basic]
Private Sub MySub() ' Add an event handler for the Scroll event. VScrollBar1.AddOnScroll New System.WinForms.ScrollEventHandler _ (AddressOf Me.VScrollBar1_Scroll) End Sub ' Scroll event handler. Private Sub VScrollBar1_Scroll(ByVal sender As System.Object, ByVal e As System.WinForms.ScrollEvent) ' Display the new value in the label. Label1.Text = "VScrollBar Value:(Scroll Event) " & CStr(VScrollBar1.Value) End Sub
ScrollEventArgs Class | ScrollEventArgs Members | System.WinForms Namespace