DataGrid.Scroll 事件
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
發生於使用者捲動 DataGrid 控制項時。
public:
event EventHandler ^ Scroll;
public event EventHandler Scroll;
member this.Scroll : EventHandler
Public Custom Event Scroll As EventHandler
事件類型
範例
下列程式碼範例示範如何使用這個成員。
// 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" );
}
// Create an instance of the 'Scroll' EventHandler.
private void CallScroll()
{
myDataGrid.Scroll += new EventHandler(Grid_Scroll);
}
// Raise the event when DataGrid is scrolled.
private 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");
}
' Create an instance of the 'Scroll' EventHandler.
Private Sub CallScroll()
AddHandler myDataGrid.Scroll, AddressOf Grid_Scroll
End Sub
' Raise the event when DataGrid is scrolled.
Private Sub Grid_Scroll(ByVal sender As Object, ByVal e As EventArgs)
' String variable used to show message.
Dim myString As String = "Scroll event raised, DataGrid is scrolled"
' Show the message when scrolling is done.
MessageBox.Show(myString, "Scroll information")
End Sub