Esempio n. 1
0
        private void button1_Click(object sender, EventArgs e)
        {
            int nRows, nCols;

            try
            {
                nRows = int.Parse(textBox1.Text);
                nCols = int.Parse(textBox2.Text);
            }
            catch (FormatException)
            {
                MessageBox.Show("Invlaid number of rows or columns specified.");
                return;
            }
            catch (OverflowException)
            {
                MessageBox.Show("Invlaid number of rows or columns specified.");
                return;
            }

            Hidato_Board board = new Hidato_Board(nCols, nRows);

            board.Show();
        }
Esempio n. 2
0
        private void buttonLoad_Click(object sender, EventArgs e)
        {
            Stream stream;

            try
            {
                stream = File.OpenRead(textBox3.Text);
            }
            catch (System.Exception)
            {
                textBox3.Text = "";
                return;
            }


            StreamReader sr = new StreamReader(stream);

            Hidato_Board board = new Hidato_Board(sr);

            sr.Close();
            stream.Close();

            board.Show();
        }