No Undo method on RadTextBox control?

2 posts, 1 answers
  1. Kipp
    Kipp avatar
    23 posts
    Member since:
    Sep 2012

    Posted 22 Feb 2013 Link to this post

    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).????
    }

  2. Answer
    Stefan
    Admin
    Stefan avatar
    2891 posts

    Posted 27 Feb 2013 Link to this post

    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.
  3. UI for WinForms is Visual Studio 2017 Ready
Back to Top