C# Moving + Flashing Label Tutorial

Syndicate

Modder
Messages
671
Reaction score
550
Points
908
Soon as C# is dead on this site I will post tutorials/codes as im am working on my BO3 program.

If for some reason u need help message me!
im not fussy about credits, so do what the fxck you want

Please, Log in or Register to view URLs content!


Code:

1. Add a timer
2. Copy this code into your timer

Code:
label1.Location = new Point(label1.Location.X + 10, label1.Location.Y);

            if (label1.Location.X > this.Width)
            {
                label1.Location = new Point(0 - label1.Width, label1.Location.Y);

                label1.Text = "GSC Is For Retards";
            }
            Random labelcolor = new Random();
            int R = labelcolor.Next(0, 255);
            int G = labelcolor.Next(0, 255);
            int B = labelcolor.Next(0, 255);
            int A = labelcolor.Next(0, 255);
            label1.ForeColor = Color.FromArgb(R, G, B, A);

Make a button to start the animation, or thread the start at beginning of your program, up to you

Button method:
*Start Animation*
Code:
        private void button1_Click(object sender, EventArgs e)
        {
            timer1.Start();
        }

*End Animation*
Code:
        private void button1_Click(object sender, EventArgs e)
        {
            timer1.Stop();
        }
 

Harry

Certified Sick ℂunt
Premium Member
Messages
1,253
Reaction score
942
Points
973
bool Started;

if(!Started)
{
Started = true;
timer1.Start();
}
else
{
Started = false;
tiimer1.Stop();
}
 

vRice

Veteran
Messages
58
Reaction score
86
Points
793
bool Started;

if(!Started)
{
Started = true;
timer1.Start();
}
else
{
Started = false;
tiimer1.Stop();
}


Nah fam you can just do this for a timer toggle

Code:
if (aTimer.Enabled)
    aTimer.Stop();
else
    aTimer.Start();
 

Syndicate

Modder
Messages
671
Reaction score
550
Points
908
are many different control toggles u could of used, they all output the same thing so doesn't really matter_
 

Harry

Certified Sick ℂunt
Premium Member
Messages
1,253
Reaction score
942
Points
973
Nah fam you can just do this for a timer toggle

Code:
if (aTimer.Enabled)
    aTimer.Stop();
else
    aTimer.Start();
That restricts a toggle to only being on a timer.
What about button.Text ="Start";
And "Stop"?
 
Top