using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Field_Demo
{
    public partial class Form1 : Form
    {
        // Deklaracja pola typu private przeznaczonego do przechowywania imienia.
        private string name = "Karol";

        public Form1()
        {
            InitializeComponent();
        }

        private void showNameButton_Click(object sender, EventArgs e)
        {
            MessageBox.Show(name);
        }

        private void button2_Click(object sender, EventArgs e)
        {
            name = "Krzysztof";
        }

        private void button3_Click(object sender, EventArgs e)
        {
            name = "Katarzyna";
        }
    }
}
