Hi,
I have a simple thing I want to do:
Move a TImage around in a form.
The TImage holds an icon of a magnifying glass, and I am trying to move the image around in a continuous circle (while another procedure is performing a search).
My problem is that the image does not move. I have tried running the code below in a thread, but still nothing happens.
What am I doing wrong?
Thanks in advance.
------------------------------------
There's no place like 127.0.0.1
------------------------------------
I have a simple thing I want to do:
Move a TImage around in a form.
The TImage holds an icon of a magnifying glass, and I am trying to move the image around in a continuous circle (while another procedure is performing a search).
My problem is that the image does not move. I have tried running the code below in a thread, but still nothing happens.
What am I doing wrong?
Thanks in advance.
Code:
procedure TForm1.Button1Click(Sender: TObject);
var
i:integer;
begin
for i:= 0 to 10 do
begin
Image1.Top := Image1.Top+3;
Image1.Left := Image1.Left-3;
sleep(1000);
Image1.Top := Image1.Top+3;
Image1.Left := Image1.Left+3;
sleep(1000);
Image1.Top := Image1.Top-3;
Image1.Left := Image1.Left+3;
sleep(1000);
Image1.Top := Image1.Top-3;
Image1.Left := Image1.Left-3;
sleep(1000);
end;
end;
------------------------------------
There's no place like 127.0.0.1
------------------------------------