Ok, so i have to sort a listbox (randomListBox) using an array (defaultArray) for university, but the instructions and tutors aren't much help, so this is what i had using the instructions but it doesn't work.
string[] defaultArray = new string[randomListBox.Items.Count];
for (int i = 0; i < randomListBox.Items.Count; i++)
{
defaultArray[i] = randomListBox.Items[i].ToString();
}
Array.Sort(defaultArray);
randomListBox.Items.Clear();
for (int i = 0; i < randomListBox.Items.Count; i++)
{
randomListBox.Items.Add(defaultArray[i].ToString());
}