Unplanned
Last Updated: 18 Jan 2022 12:57 by ADMIN
Imran
Created on: 18 Jan 2022 12:55
Category: RichTextBox
Type: Feature Request
1
RichTextBox: Add support for using the Insert key to control overtype mode

In this feature, the existing text is overridden as the user types on it with the "Insert" key is pressed on the keyboard.

Workaround: Track the state of the Insert key and delete before inserting content using the KeyDown and CommandExecuting events:

private void MainDemoControl_KeyDown(object sender, System.Windows.Input.KeyEventArgs e)
{
    if (e.KeyboardDevice.IsKeyToggled(Key.Insert))
    {
        this.isInsertKeyPressed = true;
    }
    else
    {
        this.isInsertKeyPressed = false;    
    }
}
private void radRichTextBox_CommandExecuting(object sender, CommandExecutingEventArgs e)
{
    if (e.Command is InsertTextCommand && this.isInsertKeyPressed)
    {
        this.radRichTextBox.Delete(false);
    }
}

0 comments