Guest User

Untitled

a guest
Jun 21st, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.98 KB | None | 0 0
  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.Windows.Forms;
  9.  
  10. namespace Farmer
  11. {
  12.     public partial class Form1 : Form
  13.     {
  14.         Farm farmer;
  15.         public Form1()
  16.         {
  17.             InitializeComponent();
  18.  
  19.             farmer = new Farm() { NumberOfCows = 15 };
  20.         }
  21.  
  22.         private void numericUpDown_ValueChanged(object sender, EventArgs e)
  23.         {
  24.             farmer.NumberOfCows = (int)numericUpDown.Value;
  25.         }
  26.  
  27.         private void button_Calc_Click(object sender, EventArgs e)
  28.         {
  29.             String output = String.Format("I need {0} bags of feed für {1} cows", farmer.BagsOfFeed, farmer.NumberOfCows);
  30.             MessageBox.Show(output);
  31.         }
  32.  
  33.        
  34.         private void button1_Click(object sender, EventArgs e)
  35.         {
  36.             public int BagsOfFeed { get; private set; }
  37.         }
  38.  
  39.  
  40.     }
  41. }
Add Comment
Please, Sign In to add comment