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();

Please rate this snippet

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);

Please rate this snippet

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;

Please rate this snippet

How to scroll to the top of the page in jQuery

To scroll to the top of the page in jQuery you can use the following snippet. This will scroll smmooth to the top of the page, for a instant scroll look at the Javascript Version.

Sample jQuery

$("a[href='#gotoTop']").click(function() {
  $("html, body").animate({ scrollTop: 0 }, "slow");
  return false;
});

Please rate this snippet