شاید این کد بتونه کمی کمک کنه :
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, AppEvnts;
type
TForm1 = class(TForm)
Button1: TButton;
Edit1: TEdit;
ApplicationEvents1: TApplicationEvents;
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
type myeditbox=class(tedit)
private
procedure onkeydown(var message :tmessage);message wm_killfocus ; // <- ofcourse it's not real tab key prressed
end;
var
Form1: TForm1;
i:myeditbox;
implementation
{$R *.dfm}
procedure myeditbox.onkeydown(var message:tmessage);
begin
showmessage('tab key pressed');
// if you want to don't let it to go to the another control after tab key pressed
//form1.ActiveControl:=i;
inherited;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
i:=myeditbox.create(self);
i.Left:=50;
i.Top:=50;
i.Parent:=form1;
end;
end.