private void Button_Click(object sender, RoutedEventArgs e)
        {
            int numbeofrows = Int32.Parse(inputTextbox.Text);

            if (numbeofrows < 21 && numbeofrows > 0)
            {
                Errormsg.Text       = "";
                TextBoxTickets.Text = "";
                TextBoxTickets.Text = TextBoxTickets.Text + "**************************************\n";
                TextBoxTickets.Text = TextBoxTickets.Text + "**                                  **\n";
                TextBoxTickets.Text = TextBoxTickets.Text + "**           Lotto Ticket           **\n";
                TextBoxTickets.Text = TextBoxTickets.Text + "**                                  **\n";
                TextBoxTickets.Text = TextBoxTickets.Text + "**************************************\n";
                for (int i = 0; i < numbeofrows; i++)
                {
                    ob.GenerateNUmber();
                    ob.BuddleSort();
                    TextBoxTickets.Text = TextBoxTickets.Text + ob.PrintNumbers();
                }
                TextBoxTickets.Text = TextBoxTickets.Text + "**************************************";
            }
            else
            {
                Errormsg.Text = "Enter number between 1 to 20";
            }
            char[] ac = ab.ToCharArray();
            Console.WriteLine(ac.Length);
        }
        private void ButtonSelect_Click(object sender, RoutedEventArgs e)
        {
            //Calling the lotto class
            Lotto row;
            //LuckyDip variable to store the amount of ticket rows
            int LuckyDips;

            row = new Lotto();

            //Getting the number entered in the text box and assinging it to LuckyDips variable
            LuckyDips = int.Parse(TextBoxTickets.Text);

            #region Ticket Header
            //Lotto ticket header
            TextBlockTickets.Text  = "**************************************\n";
            TextBlockTickets.Text += "**                                  **\n";
            TextBlockTickets.Text += "**           LOTTO TICKET           **\n";
            TextBlockTickets.Text += "**                                  **\n";
            TextBlockTickets.Text += "**************************************\n";
            TextBlockTickets.Text += "**                                  **\n";
            #endregion

            #region Ticket Numbers
            //Limiting the selection of numbers to between 1 and 20
            //If the number entered is higher than or equal to 21 run this:
            if (LuckyDips >= 21)
            {
                TextBlockTickets.Text += "**       Please enter a number      **\n" +
                                         "**          between 1 - 20          **\n";
            }

            //If is it less than 21 run this:
            else
            {
                //Looping through the amount of rows entered
                for (int i = 0; i < LuckyDips; i++)
                {
                    TextBlockTickets.Text += "**      ";

                    //Calling the methods in the Lotto class
                    row.SetNumbersToZero();
                    row.GenerateNumbers();
                    row.SortNumbers();
                    row.PrintNumbers(TextBlockTickets);

                    TextBlockTickets.Text += "    **\n";
                }
            }
            #endregion

            #region Ticket Footer
            //Ticket footer
            TextBlockTickets.Text += "**                                  **\n";
            TextBlockTickets.Text += "**************************************\n";
            #endregion
        }