Exemple #1
0
        private void btnDisplay_Click(object sender, EventArgs e)
        {
            Rectangle rect = new Rectangle(5, 10);

            lblOutput.Text += String.Format("You created a {0} with width {1} and height {2}. It has an area of {3}.\n", rect.GetName(), rect.width, rect.height, rect.getArea());

            Circle circ = new Circle(5);

            lblOutput.Text += String.Format("You created a {0} with a radius of {1}. It has an area of {2}.\n", circ.GetName(), circ.radius, circ.getArea());
        }