Sort ListBox numerically in C#

70

Sort ListBox numerically in C# -

ArrayList Sorting = new ArrayList(); 

foreach (var o in listBox1.Items) {
    Sorting.Add(o);
} 

Sorting.Sort(); 

listBox1.Items.Clear();

foreach (var o in Sorting) {
    listBox1.Items.Add(o); 
}

Comments

Submit
0 Comments