private void miOpen_Click(object sender, EventArgs e) { OpenFileDialog ofd = new OpenFileDialog(); if (ofd.ShowDialog() == DialogResult.OK) { database = new TrueFalse(ofd.FileName); database.Load(); nudNumber.Minimum = 1; nudNumber.Maximum = database.Count; nudNumber.Value = 1; SetAllEnabled(true); btnDelete.Enabled = (database.Count > 1); } }
private void miOpen_Click(object sender, EventArgs e) { OpenFileDialog ofd = new OpenFileDialog(); if (ofd.ShowDialog() == DialogResult.OK) { database = new TrueFalse(ofd.FileName); database.Load(); if (database.Count < 1) { MessageBox.Show("База данных пуста!", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { QuestionNumber = 1; ShowQuestion(QuestionNumber); SetEnabled(true); } } }