0
Before you start, it’s not really a virus, it’s a game. I wish that while the progressibar does not reach 100% could not close the window by clicking the button and a popup appears saying that it can not close here is the code:
private void button1_Click(object sender, EventArgs e)
{
if (progressBar1.Value != 100)
{
this.Hide();
}
else if (progressBar1.Value > 100)
{
MessageBox.Show("You need to wait the virus download");
}
}
You need the form Onclose event. I recently answered this question on Sopt.
– Andre Mesquita
progressBar1.Value > 100
????– Jéf Bueno
what is wrong?
– Pekita
It’s the other way around... Read this as
se o valor da progressbar for MAIOR que 100
.– Jéf Bueno
Thanks for the help but it is not solved yet
– Pekita
Yes, young man. That was just a comment. The answer is down there.
– Jéf Bueno
I have already found a solution thanks to those who tried to help me
– Pekita
What was the solution? I was curious :)
– Math
I made sure that when the bar reached 100% the button to close the window appeared
– Pekita