Esempio n. 1
0
        private void btnInsure_Click(object sender, EventArgs e)
        {
            //This one opens a new form of the How Much Insurance? form.
            frmInsurance a = new frmInsurance();

            a.Show();
        }
Esempio n. 2
0
        /*
         * This bit of code below sets the functionality of the Next Problem button. It starts off with hiding this window,
         * so as to more seamlessly transition. Then it creates a new form of the next problem in the book, and shows it.
         * The reason I used ShowDialog, as opposed to just Show is that I wanted to switch over to the next problem with
         * no remnants of the previous so it can be properly closed, and using ShowDialog shows the new form modally
         * (making it so directly returning to the previous form [so... THIS form] is impossible), as opposed to Show's
         * nonmodal format. Using Show makes it so the next line of code that is supposed to just close this form instead
         * closes all forms. Still not 100% certain why, but yeah, that happens.
         */
        private void btnNextProblem_Click(object sender, EventArgs e)
        {
            this.Hide();
            frmInsurance a = new frmInsurance();

            a.ShowDialog();
            this.Close();
        }