肥
肥牛
Unregistered / Unconfirmed
GUEST, unregistred user!
我使用Indy开发SMTP,想获取发送邮件的进度,使用如下的方式
procedure TForm1.SMTPWork(Sender: TObject; AWorkMode: TWorkMode;
const AWorkCount: Integer);
begin
if ProgressBar1.Max >0 then
begin
ProgressBar1.Position := AWorkCount * 100 div ProgressBar1.Max;
UpdateControlState;
end;
end;
procedure TForm1.SMTPWorkBegin(Sender: TObject; AWorkMode: TWorkMode;
const AWorkCountMax: Integer);
begin
ProgressBar1.Position :=0;
ProgressBar1.Max :=AWorkCountMax;
UpdateControlState;
end;
而为什么AWorkCountMax每次都是0?
procedure TForm1.SMTPWork(Sender: TObject; AWorkMode: TWorkMode;
const AWorkCount: Integer);
begin
if ProgressBar1.Max >0 then
begin
ProgressBar1.Position := AWorkCount * 100 div ProgressBar1.Max;
UpdateControlState;
end;
end;
procedure TForm1.SMTPWorkBegin(Sender: TObject; AWorkMode: TWorkMode;
const AWorkCountMax: Integer);
begin
ProgressBar1.Position :=0;
ProgressBar1.Max :=AWorkCountMax;
UpdateControlState;
end;
而为什么AWorkCountMax每次都是0?