public override void OnKeyPress(KeyPressEventArgs e)
{
e.Handled = true;
char ch = e.KeyChar;
if (ch >= 32 || ch == '\r') {
if (ch == '\r') ch = '\n';
UndoStack.Do(@do => {
if (@do)
this.Text += ch;
else
this.Text = this.Text.Left(this.Text.Length - 1);
}, true);
}
}