// при выборе элемента в списке двойным щелчком private void listBox1_MouseDoubleClick(object sender, MouseEventArgs e) { int index = this.listBox.SelectedIndex; Form_result form = new Form_result(this.listResults[index], false); form.ShowDialog(this); }
// кнопка Закончить private void btnExit_Click(object sender, EventArgs e) { this.btnPause.PerformClick(); // ставим на паузу тест (нажали на Пауза) if (this.result.t < this.timerInterval) { this.result.t = this.timerInterval; } // обработка не просмотренных ячеек после последней выбранной for (int j = colLastCell + 1; j < grid.Columns.Count; j++) { // подсчет пропущенных, которые нужно было отметить if (this.test.arrayDigit.Contains(Convert.ToInt32(grid.Rows[rowLastCell].Cells[j].Value)) == true) { this.result.P++; } } if (rowLastCell < grid.Rows.Count) { for (int i = rowLastCell + 1; i < grid.Rows.Count; i++) { for (int j = 0; j < grid.Columns.Count; j++) { // подсчет пропущенных, которые нужно было отметить if (this.test.arrayDigit.Contains(Convert.ToInt32(grid.Rows[i].Cells[j].Value)) == true) { this.result.P++; } } } } this.result.C = this.rowLastCell + 1; // число просмотренных строк this.result.L = this.rowLastCell * grid.Columns.Count + this.colLastCell; // общее количество просмотренных до последнего выбранного this.result.userID = this.userID; // в результат запоминаем id пользователя this.result.dateCreated = DateTime.Now; this.result.level = this.level; // Форма отображения результата // true т.к. необходимо сохранение в БД Form_result form = new Form_result(this.result, true); form.Show(this.Owner); this.Close(); }
// при выборе результата двойным щелчком мыши private void listBoxResultsAll_MouseDoubleClick(object sender, MouseEventArgs e) { int index = this.listBoxResultsAll.SelectedIndex; string fio = ""; User findUser = this.findUserInList(listResults[index].userID); if (findUser.patronymic == "") { fio = findUser.surname + " " + findUser.name[0] + "."; } else { fio = findUser.surname + " " + findUser.name[0] + "." + findUser.patronymic[0] + "."; } Form_result form = new Form_result(this.listResults[index], fio, false); form.ShowDialog(this); }