How to scroll to the end of a TreeView in C# and VB.NET

To scroll to the end of a TreeView in C# and VB.NET you can use the following snippet.

Sample VB.NET / C#

treeView1.Nodes[treeView1.Nodes.Count - 1].EnsureVisible();

How to scroll to the end of a listview in C# and VB.NET

To scroll to the end of a listview in C# and VB.NET you can use the following snippet.

Sample C# / VB.NET

listView1.EnsureVisible(listView1.Items.Count - 1);

How to scroll to the end of a Textbox in C# and VB.NET

To scroll to the end of a Textbox in C# and VB.NET you can use the following snippet.

Sample C# / VB.NET

listBox1.SelectedIndex = listBox1.Items.Count - 1;
listBox1.SelectedIndex = -1;