This is a migrated thread and some comments may be shown as answers.

No Undo method on RadTextBox control?

1 Answer 112 Views
TextBox
This is a migrated thread and some comments may be shown as answers.
Kipp
Top achievements
Rank 1
Kipp asked on 22 Feb 2013, 03:26 PM
I want my RadTextBox to undo the current changes when the user hits the Esc key.  I am using the OnKeyUp event of the RadTextBox.

However, unlike the standard Windows Forms text box, there is no Undo method on the RadTextBox.  Really???

Curiously, there is a CanUndo property on the RadTextBox...

How do I get the behavior I want?
private void radTextBox_Base_KeyUp(object sender, KeyEventArgs e)
{
    if (e.KeyCode == Keys.Escape)
        (sender as RadTextBox).????
}

1 Answer, 1 is accepted

Sort by
0
Accepted
Stefan
Telerik team
answered on 27 Feb 2013, 09:31 AM
Hi Kipp,

Thank you for writing.

RadTextBox internally hosts the standard text box and the method is present in it. Here is how to access it:
radTextBox1.TextBoxElement.TextBoxItem.TextBoxControl.Undo();

I hope this helps.

Regards,
Stefan
the Telerik team
Q3'12 SP1 of RadControls for WinForms is out now. See what's new.
Tags
TextBox
Asked by
Kipp
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Share this question
or