/// <summary>
 /// Determine which card game the user wants to play.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void whichCardGameComboBox_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (whichCardGameComboBox.SelectedIndex == 0)
     {
         Solitare_Form solitareForm = new Solitare_Form();
         solitareForm.Show();
     }
     else if (whichCardGameComboBox.SelectedIndex == 1)
     {
         TwentyOne_Game_Form twentyOneGameForm = new TwentyOne_Game_Form();
         twentyOneGameForm.Show();
     }
 }
Beispiel #2
0
        private void ChooseGameComboBox_SelectedIndexChanged(object sender, EventArgs e)
        {
            string option = "";

            option = ChooseGameComboBox.SelectedItem.ToString();
            if (option == "Solitaire")
            {
                Solitaire_Form GameForm = new Solitaire_Form();
                GameForm.Show();
            }
            else if (option == "Twenty-One")
            {
                TwentyOne_Game_Form GameForm1 = new TwentyOne_Game_Form();
                GameForm1.Show();
            }
        }
        private void Select_Card_Game_comboBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
            Select_Card_Game_comboBox1.SelectedIndexChanged += Select_Card_Game_comboBox1_SelectedIndexChanged;

            if (Select_Card_Game_comboBox1.Text == "Solitaire")
            {
                Solitaire_Game_Form solitaire = new Solitaire_Game_Form();
                solitaire.Show();
                Closer();
            }
            else if (Select_Card_Game_comboBox1.Text == "Twenty -One")
            {
                TwentyOne_Game_Form twentyOne = new TwentyOne_Game_Form();
                twentyOne.Show();
                Closer();
            }
        }
Beispiel #4
0
 private void CardGameComboBox_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (cardGameComboBox.SelectedIndex == 0)
     {
         this.Hide();
         SolitaireForm GameForm = new SolitaireForm();
         GameForm.Closed += (s, args) => this.Close();
         GameForm.Show();
     }
     else if (cardGameComboBox.SelectedIndex == 1)
     {
         this.Hide();
         TwentyOne_Game_Form GameForm = new TwentyOne_Game_Form();
         GameForm.Closed += (s, args) => this.Close();
         GameForm.Show();
     }
     else
     {
         MessageBox.Show("An error has occured");
     }
 }