private void btnHistory_Click(object sender, EventArgs e) { HistoryForm historyForm = new HistoryForm(currentNote); historyForm.FormClosed += HistoryForm_FormClosed; historyForm.StartPosition = FormStartPosition.CenterParent; historyForm.ShowDialog(); }
private void HistoryForm_FormClosed(object sender, FormClosedEventArgs e) { HistoryForm historyForm = sender as HistoryForm; if (historyForm.history != null) { btnSave.PerformClick(); currentNote.ContentText = historyForm.history.ContentText; currentNote.tags = new List <string>(); foreach (string tag in historyForm.history.Tags) { currentNote.tags.Add(tag); } NoteClick(currentNote); } }