0

i am currently developing a Progress bar (Using Winforms) that would be Shown while E-Mails are Uploaded. now the Problem I'm having is that if i Upload more than 100 E-mails, the Progress bar won't load.

here is the method which is used to set the amount for which the Progress bar is filled for each E-Mail (if there is 2 E-mails give me 2 times 50 %, if there is 4 do it in 25% Steps .........):

        public StatusUpload(int uploadAmount)
    {
        InitializeComponent();
        progressBar1.Step = 100 / uploadAmount;
    }

Does anybody know how i could solve this Problem? Thanks a lot in Advance, your help is Appreciated

4

1 回答 1

7

只需将Maximum进度条的属性设置为电子邮件数量,并在每封电子邮件发送时递增该值。鉴于此,不需要进行额外的计算。例如

progressBar1.Maximum = numberOfEmails;
foreach(var email in emails)
{
  // Send Email
  progressBar1.Value++;
}
于 2013-06-21T13:43:23.390 回答