Solved

Overriding the default tab-function in RichEdit

Posted on 1998-10-19
1
328 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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

774 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