public AnswerForm(Answer answer) { InitializeComponent(); Text = "Изменить"; answerText.Text = answer.AnswerText; answerClass.SelectedIndex = answer.ClassId - 1; }
private void button1_Click(object sender, EventArgs e) { Answer = new Answer() { AnswerText = answerText.Text, ClassId = int.Parse(answerClass.SelectedItem.ToString()) }; DialogResult = System.Windows.Forms.DialogResult.OK; Close(); }