Exemplo n.º 1
0
        private void button1_Click(object sender, EventArgs e)
        {
            peso   = double.Parse(txtpeso.Text);
            altura = double.Parse(txtaltura.Text);

            soma = (peso / (altura * altura));

            lbimc.Text = Convert.ToString(soma);

            if (soma < 18.5)
            {
                MessageBox.Show("Peso abaixo do normal!");
                var ma = new IncentivoM();
                ma.ShowDialog();
            }

            else if (soma >= 18.6 && soma <= 24.9)
            {
                MessageBox.Show("Peso Ideal!");
                MessageBox.Show("Parabens!!! Corpo são, mente sã");
                var peso = new PesoIdeal();
                peso.ShowDialog();
            }

            else if (soma >= 25 && soma < 29.9)
            {
                MessageBox.Show("Você esta um poquinho acima do Peso!");
                var gordo = new IncentivoG();
                gordo.ShowDialog();
            }
            else if (soma == 30 && soma <= 34.9)
            {
                MessageBox.Show("Obesidade 1º Grau");
                var gordo1 = new IncentivoG();
                gordo1.ShowDialog();
            }
            else if (soma == 35 && soma <= 39.9)
            {
                MessageBox.Show("Obesidade 2º Grau");
                var gordo2 = new IncentivoG();
                gordo2.ShowDialog();
            }
            else if (soma >= 40)
            {
                MessageBox.Show("Obsidade 3ºGrau");
            }
            var gordo3 = new IncentivoG();

            gordo3.ShowDialog();
        }
Exemplo n.º 2
0
        private void button1_Click(object sender, EventArgs e)
        {
            var ideal = new PesoIdeal();

            ideal.ShowDialog();
        }
Exemplo n.º 3
0
        private void btnCalcular_Click(object sender, EventArgs e)
        {
            peso   = double.Parse(txtPeso.Text);//duas maneiras de converter
            altura = double.Parse(txtAltura.Text);



            soma = (peso / (altura * altura));



            lblImc.Text = Convert.ToString(soma);

            if (soma < 18.5)
            {
                var ma = new Magro();
                ma.ShowDialog();

                txtAltura.Text = "";
                txtPeso.Text   = "";
                lblImc.Text    = "";
                this.Close();
            }
            else if (soma >= 18.6 && soma <= 24.9)
            {
                var peso = new PesoIdeal();

                peso.ShowDialog();
                txtAltura.Text = "";
                txtPeso.Text   = "";
                this.Close();
            }

            else if (soma >= 25 && soma <= 29.9)
            {
                var tela2 = new Incetivo();

                tela2.ShowDialog();
                txtAltura.Text = "";
                txtPeso.Text   = "";
                this.Close();
            }
            else if (soma >= 30 && soma <= 34.9)
            {
                var tela4 = new Incetivo();
                tela4.ShowDialog();
                txtAltura.Text = "";
                txtPeso.Text   = "";
                this.Close();
            }
            else if (soma >= 35 && soma <= 39.9)
            {
                var tela5 = new Incetivo();
                tela5.ShowDialog();
                txtAltura.Text = "";
                txtPeso.Text   = "";
                this.Close();
            }
            else if (soma >= 40)
            {
                var tela6 = new Incetivo();
                tela6.ShowDialog();
                txtAltura.Text = "";
                txtPeso.Text   = "";
                this.Close();
            }
        }