1
Before you start it’s just a game not a virus.
My goal is when the progressbar
reaches 1% put the text as downloading viruses and when it reaches 50% put the text as Installing virus but instead it just changes to Installing virus.
This is the code so far:
Timer t = new Timer();
private void LetTheGameStart_Load(object sender, EventArgs e)
{
timer1.Enabled = true;
timer1.Start();
timer1.Interval = 1000;
progressBar1.Maximum = 10;
timer1.Tick += new EventHandler(timer1_Tick);
}
void timer1_Tick(object sender, EventArgs e)
{
{
if (progressBar1.Value != 100)
{
progressBar1.Value++;
label2.Text = "Downloading Virus";
}
}
if (progressBar1.Value != 50)
{
label2.Text = "installing Virus";
}
}
Winforms, WPF or WEB? What is the type of application? Please provide more information on the question.
– gato
c# in visual studio
– Pekita
Yes, but what kind of application? Using Winforms or WPF?
– gato
I think it’s winforms. What’s the difference
– Pekita
I already know is winform
– Pekita
is already 100 but still with the same problem and the progressibar is not increasing :(
– Pekita
@Pekira Try as follows: http://pastebin.com/ncZ780NN Maybe the error is in
if (progressBar1.Value != 50)
should be:if (progressBar1.Value >= 50)
. See if it works.– stderr
When the progression is
<=50
showcaseDownloading Virus
and when it is<= 100
showcaseInstalling Virus
, that’s it?– gato
When it gets to 10 stop and I’ve already changed to 100 the max
– Pekita
not at first or 1% Installing Virus appears and when it reaches 50% shows Downloading Virus
– Pekita
I did it here, but only in a different way than yours
– gato
how did?
– Pekita
I will publish the reply
– gato