예제 #1
0
        private void tsbUndo_Click(object sender, EventArgs e)
        {
            KB9TextBox t = GetFocusedTextBox();

            if (t == null)
            {
                return;
            }
            t.Undo();
        }
예제 #2
0
        private void txtMacro1_Validating(object sender, CancelEventArgs e)
        {
            KB9TextBox t = (KB9TextBox)sender;

            if (t == null)
            {
                return;
            }
            System.Diagnostics.Debug.Print("txtMacro1_Validating " + t.Name);
            int nres = KB9Validation.ValidateKeyTextBox2(this, t);

            if (nres == 0)
            {
                t.ClearUndo();
                return;
            }

            e.Cancel = true;

            if (nres == 3) //cancel changes
            {
                t.Undo();
            }
        }