Exemplo n.º 1
0
        private void btnShortTto_Click(object sender, EventArgs e)
        {
            double temp =  100;

            foreach (Planet element in celBodies)
            {
                if (element.Shortorbit() < temp) temp = element.Shortorbit();
            }
            textBox4.Text = temp.ToString();
        }
Exemplo n.º 2
0
        private void btnReg_Click(object sender, EventArgs e)
        {
            if (rbtnStar.Checked) temp = new Star(int.Parse(tbxMass.Text), tbxDesc.Text);
            else if (rbtnPlanet.Checked)
            {
                temp = new Planet(int.Parse(tbxMass.Text), tbxDesc.Text, double.Parse(tbxTto.Text));
            }
            else temp = new Moon(int.Parse(tbxMass.Text), tbxDesc.Text, double.Parse(tbxTto.Text));

            celBodies.Add(temp);
            listBox1.Items.Add(temp + "\r\n");
        }