the slow part is when you try to join all string together

ie.

lblTextOutput.Text += tempVal + (index > 1 ? ", " : "");

to speed it up, use stringbuilder

private List<int> OutputRandomNumbers(int maxNumber)

{

StringBuilder sb = new StringBuilder();

lblTextOutput.Text = "";

List<int> numbers = new List<int>(maxNumber);

//Add each number to the list

for(int i = 1; i <= maxNumber; i++){ numbers.Add(i); }

//Re-Order the list of numbers

Random rand = new Random();

int index = numbers.Count;

while(index > 0)

{

index--;

int randomIndex = rand.Next(1, numbers.Count);

int tempVal = numbers[randomIndex];

numbers[randomIndex] = numbers[index];

numbers[index] = tempVal;

sb.Append(tempVal + (index > 1 ? ", " : ""));

}

lblTextOutput.Text = sb.ToString();

return numbers;

}

ie.

lblTextOutput.Text += tempVal + (index > 1 ? ", " : "");

to speed it up, use stringbuilder

private List<int> OutputRandomNumbers(int maxNumber)

{

StringBuilder sb = new StringBuilder();

lblTextOutput.Text = "";

List<int> numbers = new List<int>(maxNumber);

//Add each number to the list

for(int i = 1; i <= maxNumber; i++){ numbers.Add(i); }

//Re-Order the list of numbers

Random rand = new Random();

int index = numbers.Count;

while(index > 0)

{

index--;

int randomIndex = rand.Next(1, numbers.Count);

int tempVal = numbers[randomIndex];

numbers[randomIndex] = numbers[index];

numbers[index] = tempVal;

sb.Append(tempVal + (index > 1 ? ", " : ""));

}

lblTextOutput.Text = sb.ToString();

return numbers;

}