DataGrid::Scroll Event

 

Occurs when the user scrolls the System.Windows.Forms::DataGrid control.

Namespace:   System.Windows.Forms
Assembly:  System.Windows.Forms (in System.Windows.Forms.dll)

public:
event EventHandler^ Scroll {
	void add(EventHandler^ value);
	void remove(EventHandler^ value);
}

The following code example demonstrates the use of this member.

   // Create an instance of the 'Scroll' EventHandler.
private:
   void CallScroll()
   {
      myDataGrid->Scroll += gcnew EventHandler( this, &MyDataGrid::Grid_Scroll );
   }

   // Raise the event when DataGrid is scrolled.
   void Grid_Scroll( Object^ /*sender*/, EventArgs^ /*e*/ )
   {
      // String variable used to show message.
      String^ myString = "Scroll event raised, DataGrid is scrolled";

      // Show the message when scrolling is done.
      MessageBox::Show( myString, "Scroll information" );
   }

.NET Framework
Available since 1.1
Return to top
Show: