L
lovecathy
Unregistered / Unconfirmed
GUEST, unregistred user!
假设有如下控件:
-------------------
TMyControl = class(TGraphicControl)
protected
procedure Paint();
override;
public
property Canvas;
end;
procedure TMyControl.Paint();
begin
Canvas.TextOut(0, 0, DateTimeToStr(Now());
end;
-------------------
我需要实时显示当前时间,即使主线程处于“阻塞”状态,请问怎么实现一个线程,能安全的定时更新显示?
注:这个控件在主窗体上!
-------------------
TMyControl = class(TGraphicControl)
protected
procedure Paint();
override;
public
property Canvas;
end;
procedure TMyControl.Paint();
begin
Canvas.TextOut(0, 0, DateTimeToStr(Now());
end;
-------------------
我需要实时显示当前时间,即使主线程处于“阻塞”状态,请问怎么实现一个线程,能安全的定时更新显示?
注:这个控件在主窗体上!