HtmlWindow.Scroll Evento

Definizione

Si verifica quando l'utente scorre la finestra per visualizzare il testo non presente sullo schermo.Occurs when the user scrolls through the window to view off-screen text.

public:
 event System::Windows::Forms::HtmlElementEventHandler ^ Scroll;
public event System.Windows.Forms.HtmlElementEventHandler Scroll;
member this.Scroll : System.Windows.Forms.HtmlElementEventHandler 
Public Custom Event Scroll As HtmlElementEventHandler 

Tipo evento

HtmlElementEventHandler

Esempio

Nell'esempio di codice riportato di seguito viene illustrato l'utilizzo di questo membro.The following code example demonstrates the use of this member. Nell'esempio, un gestore eventi segnala l'occorrenza dell' Scroll evento.In the example, an event handler reports on the occurrence of the Scroll event. Questo report consente di apprendere quando si verifica l'evento e può facilitare il debug.This report helps you to learn when the event occurs and can assist you in debugging. Per creare report su più eventi o sugli eventi che si verificano di frequente, provare MessageBox.Show a sostituire con Console.WriteLine o ad accodare il messaggio a una riga TextBox .To report on multiple events or on events that occur frequently, consider replacing MessageBox.Show with Console.WriteLine or appending the message to a multiline TextBox.

Per eseguire il codice di esempio, incollarlo in un progetto che contiene un'istanza di tipo HtmlWindow denominata HtmlWindow1 .To run the example code, paste it into a project that contains an instance of type HtmlWindow named HtmlWindow1. Assicurarsi quindi che il gestore eventi sia associato all' Scroll evento.Then ensure that the event handler is associated with the Scroll event.

private void HtmlWindow1_Scroll(Object sender, HtmlElementEventArgs e) {

System.Text.StringBuilder messageBoxCS = new System.Text.StringBuilder();
messageBoxCS.AppendFormat("{0} = {1}", "MouseButtonsPressed", e.MouseButtonsPressed );
messageBoxCS.AppendLine();
messageBoxCS.AppendFormat("{0} = {1}", "ClientMousePosition", e.ClientMousePosition );
messageBoxCS.AppendLine();
messageBoxCS.AppendFormat("{0} = {1}", "OffsetMousePosition", e.OffsetMousePosition );
messageBoxCS.AppendLine();
messageBoxCS.AppendFormat("{0} = {1}", "MousePosition", e.MousePosition );
messageBoxCS.AppendLine();
messageBoxCS.AppendFormat("{0} = {1}", "BubbleEvent", e.BubbleEvent );
messageBoxCS.AppendLine();
messageBoxCS.AppendFormat("{0} = {1}", "KeyPressedCode", e.KeyPressedCode );
messageBoxCS.AppendLine();
messageBoxCS.AppendFormat("{0} = {1}", "AltKeyPressed", e.AltKeyPressed );
messageBoxCS.AppendLine();
messageBoxCS.AppendFormat("{0} = {1}", "CtrlKeyPressed", e.CtrlKeyPressed );
messageBoxCS.AppendLine();
messageBoxCS.AppendFormat("{0} = {1}", "ShiftKeyPressed", e.ShiftKeyPressed );
messageBoxCS.AppendLine();
messageBoxCS.AppendFormat("{0} = {1}", "EventType", e.EventType );
messageBoxCS.AppendLine();
messageBoxCS.AppendFormat("{0} = {1}", "ReturnValue", e.ReturnValue );
messageBoxCS.AppendLine();
messageBoxCS.AppendFormat("{0} = {1}", "FromElement", e.FromElement );
messageBoxCS.AppendLine();
messageBoxCS.AppendFormat("{0} = {1}", "ToElement", e.ToElement );
messageBoxCS.AppendLine();
MessageBox.Show(messageBoxCS.ToString(), "Scroll Event" );
}
Private Sub HtmlWindow1_Scroll(sender as Object, e as HtmlElementEventArgs) _ 
     Handles HtmlWindow1.Scroll

    Dim messageBoxVB as New System.Text.StringBuilder()
    messageBoxVB.AppendFormat("{0} = {1}", "MouseButtonsPressed", e.MouseButtonsPressed)
    messageBoxVB.AppendLine()
    messageBoxVB.AppendFormat("{0} = {1}", "ClientMousePosition", e.ClientMousePosition)
    messageBoxVB.AppendLine()
    messageBoxVB.AppendFormat("{0} = {1}", "OffsetMousePosition", e.OffsetMousePosition)
    messageBoxVB.AppendLine()
    messageBoxVB.AppendFormat("{0} = {1}", "MousePosition", e.MousePosition)
    messageBoxVB.AppendLine()
    messageBoxVB.AppendFormat("{0} = {1}", "BubbleEvent", e.BubbleEvent)
    messageBoxVB.AppendLine()
    messageBoxVB.AppendFormat("{0} = {1}", "KeyPressedCode", e.KeyPressedCode)
    messageBoxVB.AppendLine()
    messageBoxVB.AppendFormat("{0} = {1}", "AltKeyPressed", e.AltKeyPressed)
    messageBoxVB.AppendLine()
    messageBoxVB.AppendFormat("{0} = {1}", "CtrlKeyPressed", e.CtrlKeyPressed)
    messageBoxVB.AppendLine()
    messageBoxVB.AppendFormat("{0} = {1}", "ShiftKeyPressed", e.ShiftKeyPressed)
    messageBoxVB.AppendLine()
    messageBoxVB.AppendFormat("{0} = {1}", "EventType", e.EventType)
    messageBoxVB.AppendLine()
    messageBoxVB.AppendFormat("{0} = {1}", "ReturnValue", e.ReturnValue)
    messageBoxVB.AppendLine()
    messageBoxVB.AppendFormat("{0} = {1}", "FromElement", e.FromElement)
    messageBoxVB.AppendLine()
    messageBoxVB.AppendFormat("{0} = {1}", "ToElement", e.ToElement)
    messageBoxVB.AppendLine()
    MessageBox.Show(messageBoxVB.ToString(),"Scroll Event")

End Sub

Si applica a

Vedi anche