RichEdit Control

Started by SeaVipe, August 08, 2022, 10:24:56 PM

Previous topic - Next topic

SeaVipe

Hi Paul,

Just wondering if the RichEdit control has CTRL/i as a reserved key combination? CTRL/b and CTRL/u work as expected. My code is a KeyPress event. This behaviour is present with or without the KeyPress event checked.

The code is set to modify the selected text format to Italic, but CTRL/i appears to clear the selected text and then add a space (or 2). However, it actually does apply the Italic formatting but to see it CTRL/z must be pressed to undo whatever CTRL/i is doing. Undocumented feature.  :D
Clive Richey

Paul Squires

Hi Clive,

I checked the keyboard shortcuts in the WinAPI documentation and it doesn't look like CTRL+I is reserved.
https://docs.microsoft.com/en-us/windows/win32/controls/about-rich-edit-controls#rich-edit-shortcut-keys

Strange that your Ctrl+B and CTRL+U would work okay and CTRL+I would not. I am not sure what the problem would be.
Paul Squires
PlanetSquires Software

philbar

#2
I apologize if I'm pointing out the obvious. CTRL-I is the TAB character, CHR(9). It would be reasonable for Windows (or the RichText control) to process it and insert a TAB into the text independent of your KeyPress event. CTRL-B and CTRL-U don't have any particular text meaning.

By the way, Paul, thanks for the link. I needed that.

Phil

SeaVipe

Thanks, Paul & Philbar,

I get a Tab inserted with either CTRL+i or CTRL+Tab in a RichEdit control.
This editor uses CTRL+i to toggle italic font formatting.
Clive Richey