C# Progressbar value in foreach()
问题 I have this code: private void button1_Click(object sender, EventArgs e) { var max = 0; foreach (var address in textBox2.Text.Split(',')) { max = +1; } var maxp = 100 / max; foreach (var address in textBox2.Text.Split(',')) { SendMessage(address); progressBar1.Value = +maxp; } } It calculates how many emails are in the textbox, and then makes a proportion. To each email sent adds the value of progress, the problem is that when I press the button, the progressbar does not move. When all emails