/// <summary> /// やること追加フォーム表示 /// </summary> /// <param name="sender">オブジェクト</param> /// <param name="e">イベント</param> private void AddButton_Click(object sender, EventArgs e) { SentenceForm sentence = new SentenceForm(); sentence.FormClosed += new FormClosedEventHandler(Sentence_FormClosed); sentence.Show(); }
/// <summary> /// やること編集フォーム表示 /// </summary> /// <param name="sender">オブジェクト</param> /// <param name="e">イベント</param> private void EditButton_Click(object sender, EventArgs e) { if (SelectIndex != -1) { SentenceForm sentence = new SentenceForm(); sentence.FormClosed += new FormClosedEventHandler(Sentence_FormClosed); sentence.SetText = ToDoDataGridView.Rows[SelectIndex].Cells[3].Value.ToString(); RowDelete(); sentence.Show(); ToDoDataGridView.Refresh(); } else if (SelectIndex != -1) { MessageBox.Show("選択してください。"); } else { MessageBox.Show("複数編集はできません。"); } }