Tab key in RichEdit Control

Tab key in RichEdit Control

Postby reinaldocrespo » Wed Jan 03, 2007 1:29 am

Hi.

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



Reinaldo.
User avatar
reinaldocrespo
 
Posts: 979
Joined: Thu Nov 17, 2005 5:49 pm
Location: Fort Lauderdale, FL

Postby James Bott » Wed Jan 03, 2007 6:21 pm

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  Expand view
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
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 117 guests