Solved

Overriding the default tab-function in RichEdit

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

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…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

932 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now