0
Hi, I’m creating a project something like this: Clicko and a Proressbar appears, I increment with a Timer, I counted and qd an incremented variable of 1 in 1 reaches 11, we have +/- 3 seconds, is what I want! Then the progressibar needs to be "reset" and disappear. The process suddenly appears whenever I "clicko". BUT, Qd I do this with the progression and the timer, of a visual bug: the progressibar does not load up to the maximum, it carries about 60%, 40%, and says that the value is already full(11)! I need help, it’s for a school project!
Obs.: This code and the print are not from the project, only an example I did to exemplify the problem.
Code(Did not fit very well, see everything, please):
private void button1_Click_1(object sender, EventArgs e)
{
progressBar1.Enabled = true;
progressBar1.Visible = true;
timer1.Start();
}
private void timer1_Tick_1(object sender, EventArgs e)
{
//progressBar1.Increment(1);
progressBar1.Value += 1;
if (progressBar1.Value == 11) // 11 é o valor Maximo da ProgressBar
{
timer1.Stop();
progressBar1.Value = 0;
MessageBox.Show("oi");
progressBar1.Enabled = false;
progressBar1.Visible = true;
}
}
Sometimes it is necessary to force the visual upgrade of the components. Use
progressBar1.Refresh()
orprogressBar1.Invalidate()
afterprogressBar1.Value += 1;
– ramaral
It did not work not ;--; I used the 2 or only one of the 2, in various parts but it did not work at all :(
– Gabriel Carneiro de Sousa
How long is the timer set?
– Bruno Warmling
the same pattern, 100.
– Gabriel Carneiro de Sousa