ScrollEventArgs ScrollEventArgs ScrollEventArgs ScrollEventArgs Class

Definición

Proporciona datos para el evento Scroll.Provides data for the Scroll event.

public ref class ScrollEventArgs : EventArgs
[System.Runtime.InteropServices.ComVisible(true)]
public class ScrollEventArgs : EventArgs
type ScrollEventArgs = class
    inherit EventArgs
Public Class ScrollEventArgs
Inherits EventArgs
Herencia
ScrollEventArgsScrollEventArgsScrollEventArgsScrollEventArgs
Atributos

Ejemplos

En el ejemplo de código siguiente se muestra el uso de este miembro.The following code example demonstrates the use of this member.

void AddMyScrollEventHandlers()
{
   // Create and initialize a VScrollBar.
   VScrollBar^ vScrollBar1 = gcnew VScrollBar;

   // Add event handlers for the OnScroll and OnValueChanged events.
   vScrollBar1->Scroll += gcnew ScrollEventHandler( this, &Form1::vScrollBar1_Scroll );
   vScrollBar1->ValueChanged += gcnew EventHandler( this, &Form1::vScrollBar1_ValueChanged );
}

// Create the ValueChanged event handler.
void vScrollBar1_ValueChanged( Object^ /*sender*/, EventArgs^ /*e*/ )
{
   // Display the new value in the label.
   label1->Text = String::Format( "vScrollBar Value:(OnValueChanged Event) {0}", vScrollBar1->Value );
}

// Create the Scroll event handler.
void vScrollBar1_Scroll( Object^ /*sender*/, ScrollEventArgs^ e )
{
   // Display the new value in the label.
   label1->Text = String::Format( "VScrollBar Value:(OnScroll Event) {0}", e->NewValue );
}

void button1_Click( Object^ /*sender*/, EventArgs^ /*e*/ )
{
   // Add 40 to the Value property if it will not exceed the Maximum value.
   if ( vScrollBar1->Value + 40 < vScrollBar1->Maximum )
   {
      vScrollBar1->Value = vScrollBar1->Value + 40;
   }
}
private void AddMyScrollEventHandlers()
 {
    // Create and initialize a VScrollBar.
    VScrollBar vScrollBar1 = new VScrollBar();
 
    // Add event handlers for the OnScroll and OnValueChanged events.
    vScrollBar1.Scroll += new ScrollEventHandler(
       this.vScrollBar1_Scroll);
    vScrollBar1.ValueChanged += new EventHandler(
       this.vScrollBar1_ValueChanged); 
 }
 
 // Create the ValueChanged event handler.
 private void vScrollBar1_ValueChanged(Object sender, 
                                       EventArgs e)
 {
     // Display the new value in the label.
     label1.Text = "vScrollBar Value:(OnValueChanged Event) " + vScrollBar1.Value.ToString();
 }
 
 // Create the Scroll event handler.
 private void vScrollBar1_Scroll(Object sender, 
                                 ScrollEventArgs e)
 {
     // Display the new value in the label.
     label1.Text = "VScrollBar Value:(OnScroll Event) " + e.NewValue.ToString();
 }
 
 private void button1_Click(Object sender, 
                           EventArgs e)
 {
    // Add 40 to the Value property if it will not exceed the Maximum value.
    if (vScrollBar1.Value + 40 < vScrollBar1.Maximum)
    {
        vScrollBar1.Value = vScrollBar1.Value + 40;
    }
 }
 
Private Sub AddMyScrollEventHandlers()
    ' Create and initialize a VScrollBar.
    Dim vScrollBar1 As New VScrollBar()
    
    ' Add event handlers for the OnScroll and OnValueChanged events.
    AddHandler vScrollBar1.Scroll, AddressOf Me.vScrollBar1_Scroll
    AddHandler vScrollBar1.ValueChanged, AddressOf Me.vScrollBar1_ValueChanged
End Sub    

' Create the ValueChanged event handler.
Private Sub vScrollBar1_ValueChanged(sender As Object, e As EventArgs)
    ' Display the new value in the label.
    label1.Text = "vScrollBar Value:(OnValueChanged Event) " & _
        vScrollBar1.Value.ToString()
End Sub    

' Create the Scroll event handler.
Private Sub vScrollBar1_Scroll(sender As Object, e As ScrollEventArgs)
    ' Display the new value in the label.
    label1.Text = "VScrollBar Value:(OnScroll Event) " & _
        e.NewValue.ToString()
End Sub    

Private Sub button1_Click(sender As Object, e As EventArgs)
    ' Add 40 to the Value property if it will not exceed the Maximum value.
    If vScrollBar1.Value + 40 < vScrollBar1.Maximum Then
        vScrollBar1.Value = vScrollBar1.Value + 40
    End If
End Sub

Comentarios

El Scroll evento tiene lugar cuando el usuario cambia el valor de la barra de desplazamiento.The Scroll event occurs when the user changes the value of the scroll bar. Este evento puede obtenerse de una variedad de acciones, como hacer clic en una flecha de barra de desplazamiento, al presionar la flecha arriba o flecha abajo, o bien arrastrando el cuadro de desplazamiento.This event can result from a variety of actions, such as clicking a scroll bar arrow, pressing the UP ARROW or DOWN ARROW, or dragging the scroll box. El ScrollEventArgs especifica el tipo de evento de desplazamiento que se ha producido y el nuevo valor de la barra de desplazamiento.The ScrollEventArgs specifies the type of scroll event that occurred and the new value of the scroll bar. Use la ScrollOrientation propiedad para determinar la orientación de la barra de desplazamiento para el Scroll eventos.Use the ScrollOrientation property to determine the scroll bar orientation for the Scroll event.

El Scroll se produce un evento para el DataGridView, ScrollableControl, ScrollBar, y DataGrid controles.The Scroll event occurs for the DataGridView, ScrollableControl, ScrollBar, and DataGrid controls.

Constructores

ScrollEventArgs(ScrollEventType, Int32) ScrollEventArgs(ScrollEventType, Int32) ScrollEventArgs(ScrollEventType, Int32) ScrollEventArgs(ScrollEventType, Int32)

Inicializa una nueva instancia de la ScrollEventArgs clase utilizando los valores determinados para la Type y NewValue propiedades.Initializes a new instance of the ScrollEventArgs class using the given values for the Type and NewValue properties.

ScrollEventArgs(ScrollEventType, Int32, Int32) ScrollEventArgs(ScrollEventType, Int32, Int32) ScrollEventArgs(ScrollEventType, Int32, Int32) ScrollEventArgs(ScrollEventType, Int32, Int32)

Inicializa una nueva instancia de la ScrollEventArgs clase utilizando los valores determinados para la Type, OldValue, y NewValue propiedades.Initializes a new instance of the ScrollEventArgs class using the given values for the Type, OldValue, and NewValue properties.

ScrollEventArgs(ScrollEventType, Int32, Int32, ScrollOrientation) ScrollEventArgs(ScrollEventType, Int32, Int32, ScrollOrientation) ScrollEventArgs(ScrollEventType, Int32, Int32, ScrollOrientation) ScrollEventArgs(ScrollEventType, Int32, Int32, ScrollOrientation)

Inicializa una nueva instancia de la ScrollEventArgs clase utilizando los valores determinados para la Type, OldValue, NewValue, y ScrollOrientation propiedades.Initializes a new instance of the ScrollEventArgs class using the given values for the Type, OldValue, NewValue, and ScrollOrientation properties.

ScrollEventArgs(ScrollEventType, Int32, ScrollOrientation) ScrollEventArgs(ScrollEventType, Int32, ScrollOrientation) ScrollEventArgs(ScrollEventType, Int32, ScrollOrientation) ScrollEventArgs(ScrollEventType, Int32, ScrollOrientation)

Inicializa una nueva instancia de la ScrollEventArgs clase utilizando los valores determinados para la Type, NewValue, y ScrollOrientation propiedades.Initializes a new instance of the ScrollEventArgs class using the given values for the Type, NewValue, and ScrollOrientation properties.

Propiedades

NewValue NewValue NewValue NewValue

Obtiene o establece el nuevo Value de la barra de desplazamiento.Gets or sets the new Value of the scroll bar.

OldValue OldValue OldValue OldValue

Obtiene la antigua Value de la barra de desplazamiento.Gets the old Value of the scroll bar.

ScrollOrientation ScrollOrientation ScrollOrientation ScrollOrientation

Obtiene la orientación de la barra de desplazamiento que generó el Scroll eventos.Gets the scroll bar orientation that raised the Scroll event.

Type Type Type Type

Obtiene el tipo de evento de desplazamiento que se ha producido.Gets the type of scroll event that occurred.

Métodos

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

Determina si el objeto especificado es igual al objeto actual.Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode() GetHashCode() GetHashCode() GetHashCode()

Sirve como la función hash predeterminada.Serves as the default hash function.

(Inherited from Object)
GetType() GetType() GetType() GetType()

Obtiene el Type de la instancia actual.Gets the Type of the current instance.

(Inherited from Object)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

Crea una copia superficial del Object actual.Creates a shallow copy of the current Object.

(Inherited from Object)
ToString() ToString() ToString() ToString()

Devuelve una cadena que representa el objeto actual.Returns a string that represents the current object.

(Inherited from Object)

Se aplica a

Consulte también: