コード例 #1
0
 private void button1_Click(object sender, EventArgs e)
 {
     if (txtpesquisar.Text == "bolo de chocolate")
     {
         Tela_1 tela1 = new Tela_1();
         tela1.Show();
     }
     else if (txtpesquisar.Text == "bolo de cenoura")
     {
         Tela_2 tela2 = new Tela_2();
         tela2.Show();
     }
     else if (txtpesquisar.Text == "torta holandesa")
     {
         Tela_3 tela3 = new Tela_3();
         tela3.Show();
     }
     else if (txtpesquisar.Text == "mousse de maracuja")
     {
         Tela_4 tela4 = new Tela_4();
         tela4.Show();
     }
     else
     {
         MessageBox.Show("Busca inválida", "Aviso");
     }
     txtpesquisar.Clear();
 }
コード例 #2
0
        private void btnapre_Click(object sender, EventArgs e)
        {
            switch (cmbescolha.Text)
            {
            case "Bolo de Chocolate":
                Tela_1 tela1 = new Tela_1();
                tela1.Show();
                break;

            case "Bolo de Cenoura":
                Tela_2 tela2 = new Tela_2();
                tela2.Show();
                break;

            case "Torta Holandesa":
                Tela_3 tela3 = new Tela_3();
                tela3.Show();
                break;

            default:
                Tela_4 tela4 = new Tela_4();
                tela4.Show();
                break;
            }
            LimparTela();
        }