private void buttonEditor_Click(object sender, EventArgs e) { using (var dialog = new NoteForm()) { dialog.NoteText = this.textBoxNotes.Text; if (dialog.ShowDialog() == DialogResult.OK) this.textBoxNotes.Text = dialog.NoteText; } }