private void Form1_Load(object sender, EventArgs e)
        {
            inter = new PasTrain(150, 4, 100, 1000, Color.Black, true, true, true, Color.Yellow);
            Bitmap   bmp = new Bitmap(pictureBox1.Width, pictureBox1.Height);
            Graphics gr  = Graphics.FromImage(bmp);

            inter.drawCar(gr);
            pictureBox1.Image = bmp;
        }
 private void button4_Click(object sender, EventArgs e)
 {
     if (checkFields())
     {
         inter = new Train(maxSpeed, maxCountPass, maxCapacityGenerator, weight, color);
         Bitmap   bmp = new Bitmap(pictureBox1.Width, pictureBox1.Height);
         Graphics gr  = Graphics.FromImage(bmp);
         inter.drawCar(gr);
         pictureBox1.Image = bmp;
     }
 }