SHARE
TWEET

Form.cs

a guest Nov 19th, 2019 89 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using System.Windows.Forms;
  10.  
  11. namespace CW5
  12. {
  13.     public partial class Form1 : Form
  14.     {
  15.         int count = 0;
  16.         public Form1()
  17.         {
  18.             InitializeComponent();
  19.         }
  20.  
  21.         private void button1_Click(object sender, EventArgs e)
  22.         {
  23.  
  24.             Lorry car = null;
  25.             if (count == 0)
  26.  
  27.             {
  28.                 car = new Lorry(Convert.ToDouble(textBox4.Text), Convert.ToInt32(textBox2.Text), textBox1.Text, Convert.ToDouble(textBox3.Text));
  29.                 label5.Text = $"Был создан родительский класс\n автомобиль с параметрами:\n количество цилиндров: {car.CylilndersCount} \n марка: {car.Model} \n мощность: {car.Power} \n производный класс грузовик:\n грузоподъемность: {car.CarryingCapacity}";
  30.             }
  31.             else { car.ChangeCarryingCapacity(Convert.ToDouble(textBox4.Text)); car.ChangeModel(textBox1.Text); }
  32.             count++;
  33.         }
  34.     }
  35. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top