Tab key in RichEdit Control

Post Reply
User avatar
reinaldocrespo
Posts: 918
Joined: Thu Nov 17, 2005 5:49 pm
Location: Fort Lauderdale, FL

Tab key in RichEdit Control

Post by reinaldocrespo »

Hi.

Is there any way to allow the use of the [tab] key to work while in a richtext edit control?



Reinaldo.
User avatar
James Bott
Posts: 4654
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA
Contact:

Post by James Bott »

Reinaldo,

This is the same problem I mentioned in the other thread. The tab key is trapped in TControl and used to move to the next control. So, you will have to subclass TRichEdit and create a new keyChar() method where you can trap the Tab key before it gets to TControl.

James

Code: Select all

METHOD KeyChar( nKey, nFlags ) CLASS TRichEdit

   if ::lReadOnly
      return 0
   endif

   // Add this section. JB
   if nKey  == VK_TAB
      return 0
   endif

   Super:KeyChar( nKey, nFlags )

   ::PostMsg( FM_CHANGE )

   if ::lHighlight
      ::PostMsg( FM_HIGHLIGHT )
   endif

return nil
Post Reply