private void drawbutton_Click(object sender, RoutedEventArgs e)
        {
            int arvontojenmaara;
            Lotto lotto = new Lotto();
            if (maara.Text == "")
                arvontojenmaara = 1;
            else
                arvontojenmaara = int.Parse(maara.Text);

            for (int i = 0; i < arvontojenmaara; i++)
            {
                int[] rivi = lotto.ArvoRivi(comboBox.SelectedIndex);
                string srivi = string.Join(" ", rivi);
                listBox.Items.Add(srivi);
            }
        }
示例#2
0
        private void button_Copy_Click(object sender, RoutedEventArgs e)
        {
            Lotto lotto = new Lotto((Lotto.Tyyppi)boxTypes.SelectedIndex);

            for (int j = 0; j < int.Parse(txtDraws.Text); j++)
            {
                List<int> rivi = lotto.ArvoRivi();

                String strRivi = "";
                for (int i = 0; i < rivi.Count; i++)
                {
                    strRivi += rivi[i];
                    if (i < rivi.Count - 1)
                        strRivi += ", ";
                }

                listBox.Items.Add(strRivi);
            }
        }