title: Creating random Numbers, store them in array and sort them in two listboxes c#
body: <p>I am trying to generate random <code>int</code> numbers, once I Generate them I want to store them in a <code>listBox</code>, after this sort them in second <code>listBox</code>. The code that I have: </p>
  
  <pre><code>        int Min = 0;
          int Max = 6;
  
          // this declares an integer array with 5 elements
          // and initializes all of them to their default value
          // which is zero
          int[] test2 = new int[6];
  
          Random randNum = new Random();
          for (int i = 1; i &lt; test2.Length; i++)
          {
              test2[i] = randNum.Next(Min, Max);    
          }
          arrayListbox.ItemsSource = test2;
          Array.Sort(test2);
          foreach (int value in test2)
          {
              arrayListboxOrder.ItemsSource = test2;
          }
  </code></pre>