private void Menu_Undo(System.Object sender, System.EventArgs e)
{
// Determine if last operation can be undone in text box.
if(textBox1.CanUndo == true)
{
// Undo the last operation.
textBox1.Undo();
// Clear the undo buffer to prevent last action from being redone.
textBox1.ClearUndo();
}
}