We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you two Citrix podcasts. Learn about 2020 trends and get answers to your biggest Citrix questions!Listen Now

x

problem with NMSMTP1 and progressbar

ProgsX
ProgsX asked
on
Medium Priority
220 Views
Last Modified: 2010-04-05
I use the component (NMSMTP1) and a progressbar, and I am not create to make it function.

procedure TSendForm.Timer1Timer(Sender: TObject);
begin
  ProgressBar1.Position := NMSMTP1.BytesSent;
  StatusBar1.Panels.Items[0].Text := IntToStr(NMSMTP1.BytesSent);
  StatusBar1.Panels.Items[1].Text := IntToStr(NMSMTP1.BytesTotal);
end;

procedure TSendForm.NMSMTP1SendStart(Sender: TObject);
begin
  ProgressBar1.Max := NMSMTP1.BytesTotal;
  ProgressBar1.Min := 0;
end;

help me      
Comment
Watch Question

Commented:

Maybe you need to use the NMSMTP1PacketSent event:


procedure TForm1.NMSMTP1PacketSent(Sender: TObject);
var
i: integer;
begin
  with ProgressBar1 do
  begin
    Min := 0;
    Max := NMSMTP1.BytesTotal;
    for i := Min to Max do
    begin
      Position := NMSMTP1.BytesSent;
      StatusBar1.Panels.Items[0].Text := IntToStr(NMSMTP1.BytesSent) + ' Bytes send on ' + inttostr(NMSMTP1.BytesTotal);
    end;
  end;
StatusBar1.Panels.Items[1].Text := IntToStr(NMSMTP1.BytesTotal);
end;

Hope this help.

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts

Commented:
ProgsX,

did you test the code above ? Does it work for you ? Any feedback ?
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.