The simple but usefull AddToEnd listbox extension for C# and VB.NET.
Sample C#
public static void AddToEnd(this ListBox listbox, object data) { listbox.Items.Add(data); listbox.TopIndex = listbox.Items.Count - 1; listbox.ClearSelected(); }
Sample VB.NET
<System.Runtime.CompilerServices.Extension> _ Public Shared Sub AddToEnd(listbox As ListBox, data As Object) listbox.Items.Add(data) listbox.TopIndex = listbox.Items.Count - 1 listbox.ClearSelected() End Sub
RT @CodeSnippetsNET: AddToEnd listbox extension for .NET http://t.co/XSKWlaLH2b #csharp #vb #dotnet #programming #coding