private void buttonAdd_Click(object sender, EventArgs e) { AdminAddForm addform = new AdminAddForm(QlistView); addform.Text = "Ввод новых вопросов"; if (addform.ShowDialog(this) == DialogResult.OK) { Group = addform.button; TextFieldsData = addform.textdata; // QlistView.Items.Clear(); AddData?.Invoke(this, EventArgs.Empty); } }
private void buttonEdit_Click(object sender, EventArgs e) { if (QlistView.SelectedItems.Count == 0) { return; } AdminAddForm addform = new AdminAddForm(QlistView, QlistView.SelectedItems[0].Index); Index = int.Parse(QlistView.SelectedItems[0].SubItems[5].Text); //Index = int.Parse(QlistView.SelectedItems[0].SubItems[5].Text); addform.Text = "Редактирование вопроса"; if (addform.ShowDialog(this) == DialogResult.OK) { Group = addform.button; TextFieldsData = addform.textdata; UpdateData?.Invoke(this, EventArgs.Empty); } }