不知是否可以解决你的问题:
TForm1 = class(TForm)
F1Book1: TF1Book;
Edit1: TEdit;
procedure F1Book1KeyPress(Sender: TObject
var Key: Char);
procedure F1Book1SelChange(Sender: TObject);
private
IsNewSelect:Boolean;
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.F1Book1KeyPress(Sender: TObject
var Key: Char);
begin
F1Book1.EndEdit;
F1Book1.StartEdit(isNewSelect,false,false);
if isNewSelect then
Edit1.Text :=key
else
Edit1.Text :=F1Book1.text+Key;
IsNewSelect:=False;
end;
procedure TForm1.F1Book1SelChange(Sender: TObject);
begin
isNewSelect:=True;
end;