コード例 #1
0
        private void button5_Click(object sender, EventArgs e)   //NO
        {
            if (this.formno == 0)
            {
                this.Hide();
                Form1 f = new Form1();
                f.ShowDialog();
            }
            else if (this.formno == 1)
            {
                if (this.category == 1)
                {
                    this.Hide();
                    Mathematics m = new Mathematics();
                    m.ShowDialog();
                }
                if (this.category == 2)
                {
                    this.Hide();
                    General_Knowledge gk = new General_Knowledge();
                    gk.ShowDialog();
                }
                if (this.category == 3)
                {
                    this.Hide();
                    Science sc = new Science();
                    sc.ShowDialog();
                }
                if (this.category == 4)
                {
                    this.Hide();
                    Computer comp = new Computer();
                    comp.ShowDialog();
                }
            }

            else if (this.formno == 3)
            {
                this.Hide();
                Play p = new Play();
                p.ShowDialog();
            }
            else if (this.formno == 2)
            {
                this.Hide();
                Difficulty d = new Difficulty();
                d.ShowDialog();
            }
        }
コード例 #2
0
        private void button3_Click(object sender, EventArgs e)    // CATEGORY for gk
        {
            int request = 0;
            DFA dfa     = new DFA(currentstate);
            int answer  = dfa.transition(currentstate, request);

            if (answer == 1)
            {
                this.Hide();
                General_Knowledge gk = new General_Knowledge();
                gk.ShowDialog();
            }
            else
            {
                MessageBox.Show("You have a mistake in selection.");
            }
        }