Разработка программы с целью обработки и сортировки чисел, страница 5

            this.button6.UseVisualStyleBackColor = true;

            this.button6.Click += new System.EventHandler(this.button6_Click);

            //

            // button1

            //

            this.button1.Enabled = false;

            this.button1.Location = new System.Drawing.Point(420, 236);

            this.button1.Name = "button1";

            this.button1.Size = new System.Drawing.Size(278, 23);

            this.button1.TabIndex = 7;

            this.button1.Text = "Начало сортировки";

            this.button1.UseVisualStyleBackColor = true;

            this.button1.Click += new System.EventHandler(this.button1_Click);

            //

            // button2

            //

            this.button2.Enabled = false;

            this.button2.Location = new System.Drawing.Point(242, 236);

            this.button2.Name = "button2";

            this.button2.Size = new System.Drawing.Size(149, 23);

            this.button2.TabIndex = 8;

            this.button2.Text = "Конец сортировки";

            this.button2.UseVisualStyleBackColor = true;

            this.button2.Click += new System.EventHandler(this.button2_Click);

            //

            // openFileDialog1

            //

            this.openFileDialog1.Filter = "Текстовые файлы|*.txt|Все файлы|*.*";

            //

            // openFileDialog2

            //

            this.openFileDialog2.Filter = "Текстовые файлы|*.txt|Все файлы|*.*";

            //

            // saveFileDialog1

            //

            this.saveFileDialog1.Filter = "Текстовые файлы|*.txt|Все файлы|*.*";

            //

            // saveFileDialog2

            //

            this.saveFileDialog2.Filter = "Текстовые файлы|*.txt|Все файлы|*.*";

            //

            // fMain

            //

            this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);

            this.BackColor = System.Drawing.Color.Gainsboro;

            this.ClientSize = new System.Drawing.Size(722, 490);

            this.Controls.Add(this.button6);

            this.Controls.Add(this.button5);

            this.Controls.Add(this.button4);

            this.Controls.Add(this.button3);

            this.Controls.Add(this.listBox4);

            this.Controls.Add(this.listBox3);

            this.Controls.Add(this.button2);

            this.Controls.Add(this.button1);

            this.Controls.Add(this.listBox2);

            this.Controls.Add(this.listBox1);

            this.Controls.Add(this.lb_read);

            this.Controls.Add(this.textBox1);

            this.Controls.Add(this.lRes);

            this.Controls.Add(this.bStart);

            this.Controls.Add(this.tbInData);

            this.Controls.Add(this.mmMenu);

            this.ForeColor = System.Drawing.Color.Red;

            this.MainMenuStrip = this.mmMenu;

            this.Name = "fMain";

            this.Text = "ОКНО ПРОГРАММЫ";

            this.Load += new System.EventHandler(this.fMain_Load);

            this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.fMain_FormClosed);

            this.mmMenu.ResumeLayout(false);

            this.mmMenu.PerformLayout();

            this.ResumeLayout(false);

            this.PerformLayout();

        }

        #endregion

        /// <summary>

        /// The main entry point for the application.

        /// </summary>

        [STAThread]

        static void Main()

        {

            Application.Run(new fMain());

        }

        private void textBox1_TextChanged(object sender, System.EventArgs e)

        {

            if (Error)

            {

                Error = false;

                string S;

                int L;

                S = tbInData.Text;

                L = tbInData.TextLength;

                tbInData.Text = S.Substring(0, L - 1);

                tbInData.SelectionStart = L - 1;//Позиция курсора

            }

        }

        private void bStart_Click(object sender, System.EventArgs e)

        {

           if (Mode)//Mode-логическая переменная

            {

                textBox1.Clear();

                tbInData.Clear();

                Mode = false;

                bStart.Text = "Стоп";

                miStart.Text = "стоп";

                tbInData.Enabled = true;

                tbInData.Focus();

                tClock.Start();

            }

            else

            {

                Mode = true;

                bStart.Text = "Пуск";

                miStart.Text = "Пуск";

                tbInData.Enabled = false;

                textBox1.Enabled = false;

                tClock.Stop();

                if ((tbInData.TextLength < 5) | (textBox1.TextLength < 8))

                {

                    bStart.Text = "ошибка";

                }

                else

                {

                    this.MyObject.Write(tbInData.Text, textBox1.Text);

                    this.MyObject.Arbeit();

                    lRes.Text = "Результат" + this.MyObject.Read();

                }

            }

        }

        private void fMain_Load(object sender, System.EventArgs e)

        {

            Mode = true;//начальные значения глобальной переменной

            Error = false;

            this.MyObject = new work();

            this.MyObject.CatchTime();

            this.Hallo = new fAbout();

            this.Hallo.tAbout.Start();

            this.Hallo.ShowDialog();//вывод на экран приветствия

        }

        private void tClock_Tick(object sender, System.EventArgs e)

        {

            tClock.Stop();

            MessageBox.Show("Прошло 15 сек!");

            tClock.Start();

        }

        private void tbInData_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e)

        {

            tClock.Stop();

            tClock.Start();

            if ((e.KeyChar >= '0') & (e.KeyChar <= '9'))