示例#1
0
        private void Form2_Load(object sender, EventArgs e)
        {
            car Car2 = new car();

            Car2.color            = "black";
            Car2.speed            = 210;
            Car2.motor            = 1195;
            Car2.price            = 180000;
            Car2.status           = 's';
            Car2.Brand            = "bmw";
            Car2.Year             = 1996;
            Car2.control          = 2017;
            Car2.licenceplate     = "89 JK 1092";
            Car2.owner            = "Jane Eyre";
            label1.Text           = Car2.color;
            label2.Text           = Car2.speed.ToString();
            label3.Text           = Car2.motor.ToString();
            label4.Text           = Car2.price.ToString();
            label5.Text           = Car2.status.ToString();
            pictureBox1.BackColor = Color.Chocolate;
            label6.Text           = Car2.Brand;
            label7.Text           = Car2.Year.ToString();
            label8.Text           = Car2.Year.ToString();
            label9.Text           = Car2.control.ToString();
            label10.Text          = Car2.licenceplate;
        }
示例#2
0
        private void Form1_Load(object sender, EventArgs e)
        {
            car Car = new car();

            Car.color             = "gray";
            Car.speed             = 240;
            Car.motor             = 1394;
            Car.price             = 200000;
            Car.status            = 'n';
            Car.Brand             = "cadillac";
            Car.Year              = 1980;
            Car.control           = 2019;
            Car.licenceplate      = "89 AI 1234";
            Car.owner             = "Mr. Bean";
            label1.Text           = Car.color;
            label2.Text           = Car.speed.ToString();
            label3.Text           = Car.motor.ToString();
            label4.Text           = Car.price.ToString();
            label5.Text           = Car.status.ToString();
            label6.Text           = Car.Brand;
            label7.Text           = Car.Year.ToString();
            pictureBox1.BackColor = Color.Crimson;
            label8.Text           = Car.Year.ToString();
            label9.Text           = Car.control.ToString();
            label10.Text          = Car.licenceplate;
        }