Version

Scroll Event

Occurs when the UltraTree control is scrolled via the scrollbars.
Syntax
'Declaration
 
Public Event Scroll As TreeScrollEventHandler
public event TreeScrollEventHandler Scroll
Event Data

The event handler receives an argument of type TreeScrollEventArgs containing data related to this event. The following TreeScrollEventArgs properties provide information specific to this event.

PropertyDescription
ScrollBarType (Read-only) Returns the type of the scrollbar (horizontal or vertical) that generated the UltraTree.Scroll event.
ScrollEventArgs (Read-only) Returns the ScrollEventArgs that describe the type of scroll operation that occurred.
Example
The following sample code illustrates some of the information available in the Scroll event.

For an overview of how to handle events in Visual Basic or Visual C#, see Event Handlers in Visual Basic and Visual C#. For specific information and code examples illustrating how to consume events in your application, see Consuming Events in the .NET Framework Developer's Guide.

Imports Infragistics.Win.UltraWinTree

Private Sub ultraTree1_Scroll(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinTree.TreeScrollEventArgs) Handles ultraTree1.Scroll

    Dim sb As New System.Text.StringBuilder()

    sb.Append("The tree has scrolled. ScrollbarType :")
    sb.Append(e.ScrollBarType)
    sb.Append(" ScrollEventType: ")
    sb.Append(e.ScrollEventArgs.Type)
    sb.Append(" new value: ")
    sb.Append(e.ScrollEventArgs.NewValue)

    Debug.WriteLine(sb.ToString())

End Sub
using System.Diagnostics;
using Infragistics.Win.UltraWinTree;

private void ultraTree1_Scroll(object sender, Infragistics.Win.UltraWinTree.TreeScrollEventArgs e)
{

	System.Text.StringBuilder sb = new System.Text.StringBuilder();

	sb.Append("The tree has scrolled. ScrollbarType :");
	sb.Append(e.ScrollBarType);
	sb.Append(" ScrollEventType: ");
	sb.Append(e.ScrollEventArgs.Type);
	sb.Append(" new value: ");
	sb.Append(e.ScrollEventArgs.NewValue);

	Debug.WriteLine( sb.ToString() );
		
}
Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also