Esempio n. 1
0
        //Создание нового файла
        private void toolStripMenuItem3_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();
                numericUpDown1.Minimum = 1;
                numericUpDown1.Maximum = 1;
                numericUpDown1.Value   = 1;
            }
        }
Esempio n. 2
0
        //Открываем базу
        private void toolStripMenuItem1_Click(object sender, EventArgs e)
        {
            OpenFileDialog openFileDialog = new OpenFileDialog();

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

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