void Undo() { IEdit atb = fm.CurrentControl as IEdit; if (atb != null && ((Control)atb).Focused) { atb.Undo(); } }