Solved

Overriding the default tab-function in RichEdit

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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

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…
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…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

758 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

17 Experts available now in Live!

Get 1:1 Help Now