Approved
Last Updated: 30 Mar 2016 10:56 by Svetlin
Svetlin
Created on: 17 Apr 2012 04:44
Category: RichTextEditor
Type: Bug Report
3
FIX. RadRichTextEditor - control processing does not obey e.Handled when KeyPress event is raised.
Workaround:

public class MyInputBehavior : InputBehavior
{
    public MyInputBehavior(DocumentView view)
        : base(view)
    {
  
    }
  
    public override bool ProcessKeyPress(System.Windows.Forms.KeyPressEventArgs e)
    {
        // TO DO: You code here
        e.KeyChar = char.ToUpper(e.KeyChar);
        return true;
        // By commenting the base call you are supresing the default logic
        //return base.ProcessKeyPress(e);
    }
}

Then you should replace the default input behavior by using the following code snippet:
this.richTextBox.DocumentView.InputBehavior = new MyInputBehavior(this.richTextBox.DocumentView);
0 comments