Ejemplo n.º 1
0
        private void button1_Click_1(object sender, EventArgs e)
        {
            ListBox.ObjectCollection list = PlayList.Items;
            Random random = new Random();
            int    w      = list.Count;

            PlayList.BeginUpdate();
            while (w > 1)
            {
                w--;
                int    u     = random.Next(w + 1);
                object value = list[u];
                list[u] = list[w];
                list[w] = value;
            }
            PlayList.EndUpdate();
            PlayList.Invalidate();
        }