public Form1()
 {
     InitializeComponent();
     backgroundWorker3.WorkerReportsProgress = true;
     backgroundWorker3.WorkerSupportsCancellation = true;
     backgroundWorker3.RunWorkerAsync();
     okno = new Klasa();
 }
        private void Form1_Load(object sender, EventArgs e)
        {
            if (File.Exists(FileName))
            {
                //Stream TestFileStream = File.OpenRead(FileName);
                //BinaryFormatter deserializer = new BinaryFormatter();
                //okno = (Klasa)deserializer.Deserialize(TestFileStream);
                //TestFileStream.Close();


                System.Xml.Serialization.XmlSerializer reader =
                    new System.Xml.Serialization.XmlSerializer(typeof(Klasa));
                System.IO.StreamReader file = new System.IO.StreamReader(
                    FileName);
                okno = (Klasa)reader.Deserialize(file);
                file.Close();

                textBox2.Text = okno.okno;
                progressBar1.Value = okno.procent;
            }
        }