コード例 #1
0
        public override void DetachEditingControl()
        {
            DataGridView dataGridView = base.DataGridView;

            if ((dataGridView == null) || (dataGridView.EditingControl == null))
            {
                throw new InvalidOperationException();
            }
            MaskedTextBox editingControl = dataGridView.EditingControl as MaskedTextBox;

            if (editingControl != null)
            {
                editingControl.ClearUndo();
            }
            base.DetachEditingControl();
        }
コード例 #2
0
        public override void DetachEditingControl()
        {
            DataGridView dataGridView = base.DataGridView;

            if (dataGridView == null || dataGridView.EditingControl == null)
            {
                throw new InvalidOperationException();
            }
            MaskedTextBox maskedTextBox = dataGridView.EditingControl as MaskedTextBox;

            if (maskedTextBox != null)
            {
                maskedTextBox.ClearUndo();
            }
            base.DetachEditingControl();
        }
コード例 #3
0
        public void UndoTest()
        {
            MaskedTextBox mtb;

            mtb      = new MaskedTextBox();
            mtb.Text = "abcdef";
            Assert.AreEqual(false, mtb.CanUndo, "#A0-c");
            mtb.Undo();
            Assert.AreEqual("abcdef", mtb.Text, "#A1");
            Assert.AreEqual(false, mtb.CanUndo, "#A1-c");
            mtb.Text = "cdef";
            mtb.ClearUndo();
            Assert.AreEqual("cdef", mtb.Text, "#A2");
            Assert.AreEqual(false, mtb.CanUndo, "#A2-c");

            mtb.Dispose();
        }