private void button1_Click(object sender, EventArgs e)
        {
            menu m = new menu();

            m.Show();
            this.Close();
        }
 private void button1_Click(object sender, EventArgs e)
 {
     if (comboBox1.Text.Length > 0)
     {
         this.Hide();
         menu m = new menu();
         m.GetData(comboBox1.Text, filesname[comboBox1.SelectedIndex]);
         DataProfil.Name          = comboBox1.Text;
         DataProfil.PathForProfil = filesname[comboBox1.SelectedIndex];
         m.Show();
     }
 }
 private void button3_Click(object sender, EventArgs e)
 {
     this.Close();
     Menu.Show();
 }
        private void Form1_Load(object sender, EventArgs e)
        {
            //if (openFileDialog1.ShowDialog() == DialogResult.Cancel)
            //    return;
            //// получаем выбранный файл
            //string filename = openFileDialog1.FileName;
            bool chekP = true;

            try
            {
                StreamReader rd = new StreamReader(filename);
                rd.ReadToEnd();
                rd.Close();
            }
            catch
            {
                chekP = false;
                this.Close();
                pathToClass.Show();
            }
            if (chekP)
            {
                a = new C_interf();

                a.GettingDataFromAFile(filename);
                if (typeConstructor)
                {
                    string strv = a.GetTestSubject() + "|" + a.GetTestSection() + "|" + a.GetTestName() + "|" + filename;
                    string path = @"Pathes\pathes.txt";

                    StreamWriter sw = new StreamWriter(path, true, Encoding.Default);
                    sw.WriteLine(strv);
                    sw.Close();
                }
                label4.Text       = schv + " из " + a.GetQuestionCount();
                label1.Text       = "Тема " + a.GetTestName();
                label2.Text       = "Раздел " + a.GetTestSection();
                label3.Text       = "Предмет " + a.GetTestSubject();
                richTextBox5.Text = a.GetQuestionText();

                if (a.GetAnswerType(0) == "text")
                {
                    richTextBox1.Text = a.GetTextAnswers(0);
                }
                else
                {
                    op1.Visible = !op1.Visible;

                    op1.Image = StrToImg(a.GetTextAnswers(0));
                }

                if (a.GetAnswerType(1) == "text")
                {
                    richTextBox2.Text = a.GetTextAnswers(1);
                }
                else
                {
                    op2.Visible = !op2.Visible;

                    op2.Image = StrToImg(a.GetTextAnswers(1));
                }

                if (a.GetAnswerType(2) == "text")
                {
                    richTextBox3.Text = a.GetTextAnswers(2);
                }
                else
                {
                    op3.Visible = !op3.Visible;

                    op3.Image = StrToImg(a.GetTextAnswers(2));
                }
                if (a.GetAnswerType(3) == "text")
                {
                    richTextBox4.Text = a.GetTextAnswers(3);
                }
                else
                {
                    op4.Visible = !op4.Visible;

                    op4.Image = StrToImg(a.GetTextAnswers(3));
                }
            }
        }