[阅读: 334] 2008-08-25 01:47:02
procedure TMyThread.Execute;
begin
inherited;
FStrCopy := Copy(FStr, 1, 3);
Self.Synchronize(ShowCopy);
end;
procedure TMyThread.ShowCopy;
begin
Label1.Caption := FStrCopy;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
FThread := TMyThread.Create(True);
FThread.Label1 := Self.Label1;
FThread.FStr := Edit1.Text;
FThread.FreeOnTerminate := True;
FThread.Resume;
end;