System.Windows.Forms.TextBoxBase.Undo C# (CSharp) Method

Undo() private method

private Undo ( ) : void
return void
		public void Undo ()
		{
			//if (m_helper.TextView.undo) {
			//	Modified = true;
			//	OnTextChanged (EventArgs.Empty);
			//}
		}
		

Usage Example

Example #1
0
        public static bool Undo()
        {
            bool res = Execute(OnUndo);

            if (!res)
            {
                Control activeControl = Application.ActiveControl;
                if (activeControl == null)
                {
                    return(false);
                }

                System.Windows.Forms.TextBoxBase active = activeControl as System.Windows.Forms.TextBoxBase;
                res = active != null;
                if (res)
                {
                    active.Undo();
                }
                else
                {
                    MethodInfo method = activeControl.GetType().GetMethod("Undo");
                    if (method != null)
                    {
                        Clipboard.FunctionWithoutReturn getMethod = (Clipboard.FunctionWithoutReturn)Delegate.CreateDelegate
                                                                        (typeof(Clipboard.FunctionWithoutReturn), activeControl, method);

                        getMethod();
                        res = true;
                    }
                }
            }
            return(res);
        }