Ticket Q511422
Visible to All Users

RichEditControl: The delete key(Supr) acts like the backspace

created 12 years ago

Hello, I'm using devexpress richeditcontrol and
I have a problem with the key delete (in spanish keyboard 'Supr'). When I push it the caret delete letter before it, like backspace, but I need it works like spanish keyboard, deleting letters (or objects) after the caret. Is there any option on control?
Thanks and best regards.

Answers approved by DevExpress Support

created 12 years ago (modified 12 years ago)

Hi,
You can use the approach illustrated in the How to change the shortcut key assigned to a command code example to remap keys. For instance, this sample code illustrates how to force the BACKSPACE key to behave in the same manner as the DELETE key does:

C#
richEditControl1.RemoveShortcutKey(Keys.Back, Keys.None); richEditControl1.AssignShortcutKeyToCommand(Keys.Back, Keys.None, RichEditCommandId.Delete);

I hope this information helps you.
Thanks,
Alessandro.

    Comments (2)

      this not work for my code. I think you have understood bad my question. I don't need replace backspace key action. The problem is that when I push DELETE key, it works like BACKSPACE key and I haven't overrided any key shortkeycommand.
      Do you understand?
      Thanks and best regards

      Alessandro (DevExpress Support) 12 years ago

        I understand your scenario. You can use the recommended approach to modify this behavior. I have illustrated how to modify the BACKSPACE key behavior. You can use the same approach to modify any other key behavior. For instance, try the following code:

        C#
        richEditControl1.RemoveShortcutKey(Keys.Delete, Keys.None); richEditControl1.AssignShortcutKeyToCommand(Keys.Delete, Keys.None, RichEditCommandId.Delete);

        Does this information help you?

        Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

        Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.