Solved

Overriding the default tab-function in RichEdit

Posted on 1998-10-19
1
332 Views
Last Modified: 2013-11-22
How do I override the default action executed when the tab-key is pressed in RichEdit? I want to dissable the function that inserts tab-characters, but I still want to react when the tab-key is pressed. ( I am going to insert spaces instead... )
0
Comment
Question by:kaa_lang
1 Comment
 
LVL 12

Accepted Solution

by:
rwilson032697 earned 100 total points
ID: 1343405
You will need to create a class descended from TRichEdit and override the WMChar method:

type
  TMyRichEdit = class(TRichEdit)
  protected
    procedure WMChar(var Message : TWMChar); message WM_CHAR;
end;

procedure TMyRichEdit.WMChar(var  Message : TWMChar);
begin
  if Message.CharCode = VK_TAB then
    // do your stuff here
 else
    Inherited;
end;

Cheers,

Raymond.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Delphi IDE crash without error message ... 7 119
Delphi and Access based Enumeration 9 78
Firemonkey Queue list 1 31
TlistView is Really heavy on Android 3 18
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question