dibrave的方法不错,就是声明变量时少了一个,应该这样:
procedure TForm1.Timer1Timer(Sender: TObject);
var x,y,[red]i[/red]:integer;
begin
x:=strtoint(edit1.text);
y:=strtoint(edit2.text);
if i=1 then
begin canvas.pen.style:=psclear;
canvas.brush.color:=clbtnface;
canvas.ellipse(x-10,y-10,x+10,y+10);
i:=0;
end
else
begin
i:=1;canvas.pen.style:=psclear;
canvas.brush.color:=$0000ff;
canvas.ellipse(x-10,y-10,x+10,y+10);
end;
end;