Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Overriding the default tab-function in RichEdit

Posted on 1998-10-19
1
Medium Priority
?
336 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 12

Accepted Solution

by:
rwilson032697 earned 400 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Suggested Courses

636 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