private void menuUndo_Click(object sender, EventArgs e) { DoInActiveTextBox(ctrl => { if (ctrl.CanUndo) { ctrl.Undo(); } }); }