Exemplo n.º 1
0
        //Новый файл
        private void menuItemNew_Click(object sender, EventArgs e)
        {
            SaveFileDialog saveFileDialog = new SaveFileDialog();

            if (saveFileDialog.ShowDialog() == DialogResult.OK)
            {
                database = new TrueFalse(saveFileDialog.FileName);
                database.Add("123", true);
                database.Save();
                nudNumber.Minimum = 1;
                nudNumber.Maximum = 1;
                nudNumber.Value   = 1;
            }
        }
Exemplo n.º 2
0
        private void btnPlay_Click(object sender, EventArgs e)
        {
            btnYes.Enabled = true;
            btnNo.Enabled  = true;

            database = new TrueFalse(AppDomain.CurrentDomain.BaseDirectory + "hm8.txt");
            database.Load();

            if (database.Count != 0)
            {
                tbQuestion.Text = database[count].Text;
            }

            quest.Text      = "Вопрос #" + (count + 1);
            correctA.Text   = "Правильных ответов: " + countA;
            btnPlay.Enabled = false;
        }
Exemplo n.º 3
0
        //Открыть
        private void menuItemOpen_Click(object sender, EventArgs e)
        {
            OpenFileDialog openFileDialog = new OpenFileDialog();

            if (openFileDialog.ShowDialog() == DialogResult.OK)
            {
                database = new TrueFalse(openFileDialog.FileName);
                database.Load();
                nudNumber.Minimum = 1;
                nudNumber.Maximum = database.Count;
                nudNumber.Value   = 1;

                if (database.Count != 0)
                {
                    tbQuestion.Text = database[0].Text;
                    cbTrue.Checked  = database[0].TrueFalse;
                }
            }
        }