在Edit的OnKeypress事件中:
procedure TForm1.Edit1KeyPress(Sender: TObject; var Key: Char);
var s:String;
begin
s:='×';
if key='*' then
begin
key:=#0;
Edit1.Text:=Edit1.Text+s;
Edit1.SelStart:=length(Edit1.Text);
end;
end;
procedure TForm1.Edit1Change(Sender: TObject);
var
s:string;
begin
s:=(Sender as TEdit).text;
if copy(s,length(s),1)='*' then
begin
s:=copy(s,1,length(s)-1)+'×';
end;
(Sender as TEdit).Text:=s;
(Sender as TEdit).SelStart:=length(s);
end;