Post: C# [Flashing Text Form1] C#
07-31-2015, 04:02 PM #1
Ali
Can’t trickshot me!
(adsbygoogle = window.adsbygoogle || []).push({}); Hey, I've been trying to figure out a way to make the title of my Form1 flash.

I've seen a post before about this and it works for components and i would like to know if it is able to be done with the title of the form.
I've heard it is possible to do so but i cant figure out how.
I've tried multiple ways to try get around it but i still get an error.


You must login or register to view this content.


It is a Metro style form, i don't know if that's necessary to say but it'd be better to state so.

What I have done in code for this function to work is...

You must login or register to view this content.

This is basically when the application starts the timer (timer2) starts for the colour changing function.
Ignore the Textbox limit code.

You must login or register to view this content.

This is the type of colours that randomly come.
The last line is supposed to mean that the default fore colour of the form are the colours from the ARGB (the lines above) but im not able to do so and im not able to somehow get around this.


Maybe it's the style of the code or i may have put things in the wrong place.

- Thanks
(adsbygoogle = window.adsbygoogle || []).push({});
07-31-2015, 04:51 PM #2
CyberNomadic
Web Developer
Have you tried Form1.ForeColor instead?
07-31-2015, 05:54 PM #3
Ali
Can’t trickshot me!
Originally posted by CyberNomadic View Post
Have you tried Form1.ForeColor instead?


Its not available like its not in context. It doesn't fit. Only defaultforecolor bro
07-31-2015, 09:09 PM #4
Toxic
former staff
Originally posted by Ali View Post
Hey, I've been trying to figure out a way to make the title of my Form1 flash.

I've seen a post before about this and it works for components and i would like to know if it is able to be done with the title of the form.
I've heard it is possible to do so but i cant figure out how.
I've tried multiple ways to try get around it but i still get an error.


You must login or register to view this content.


It is a Metro style form, i don't know if that's necessary to say but it'd be better to state so.

What I have done in code for this function to work is...

You must login or register to view this content.

This is basically when the application starts the timer (timer2) starts for the colour changing function.
Ignore the Textbox limit code.

You must login or register to view this content.

This is the type of colours that randomly come.
The last line is supposed to mean that the default fore colour of the form are the colours from the ARGB (the lines above) but im not able to do so and im not able to somehow get around this.


Maybe it's the style of the code or i may have put things in the wrong place.

- Thanks


here, i fixed the code for u:

put this in a timer, and enable the timer (By clicking properties, and change from "false" to "true", and put the interval u want, i would recmmond 1000)

Random rand = new Random();
int A = rand.Next(0, 255);
int R = rand.Next(0, 255);
int G = rand.Next(0, 255);
int B = rand.Next(0, 255);
/*urLabelName*/.ForeColor = Color.FromArgb(A, R, G, B);
08-02-2015, 04:18 AM #5
jagex
Gym leader
If you are talking about the title bar then no you cannot change it by modifying the properties as its a non-client area. Though there a couple of work arounds. Just google it
08-09-2015, 08:26 PM #6
Chen Madhala
Pokemon Trainer
Originally posted by Ali View Post
Hey, I've been trying to figure out a way to make the title of my Form1 flash.

I've seen a post before about this and it works for components and i would like to know if it is able to be done with the title of the form.
I've heard it is possible to do so but i cant figure out how.
I've tried multiple ways to try get around it but i still get an error.


You must login or register to view this content.


It is a Metro style form, i don't know if that's necessary to say but it'd be better to state so.

What I have done in code for this function to work is...

You must login or register to view this content.

This is basically when the application starts the timer (timer2) starts for the colour changing function.
Ignore the Textbox limit code.

You must login or register to view this content.

This is the type of colours that randomly come.
The last line is supposed to mean that the default fore colour of the form are the colours from the ARGB (the lines above) but im not able to do so and im not able to somehow get around this.


Maybe it's the style of the code or i may have put things in the wrong place.

- Thanks


This is my idea
You can change the text form to whatever you like, but it's impossible as i remmember to change the color of it
So, you should just use a label.
Instead of copying and pasting code il explain you how it works:
First you need to define a definition of Random so
    Random Rand /*Or any other name*/ = new Random()

Now to define the random color
    
int A = Rand.Next(200, 255); //Will generate a random number beetwen 200 to 255
int R = Rand.Next(0, 255); //Will generate a random number beetwen 0 to 255
int G = Rand.Next(0, 255); //Will generate a random number beetwen 0 to 255
int B = Rand.Next(0, 255); //Will generate a random number beetwen 0 to 255


A it's the opacity of the label (0 = None, 255 = Full) So i recommended to use a number beetwen 200 to 255 so the label will be visible enough to understand.
Next just put the label name color
    YourLabel.ForeColor =  Color.FromArbg(A,R,G,B);

You can change the numbers of the random numbers to whatever you like, than it will generate other colors
Make sure you put the Random definition outside of the timer void loop (So it will be global variable) than it wont need to make a new definition of the Random everytime that the loop ends.
08-09-2015, 09:03 PM #7
Ali
Can’t trickshot me!
Originally posted by Chen
This is my idea
You can change the text form to whatever you like, but it's impossible as i remmember to change the color of it
So, you should just use a label.
Instead of copying and pasting code il explain you how it works:
First you need to define a definition of Random so
    Random Rand /*Or any other name*/ = new Random()

Now to define the random color
    
int A = Rand.Next(200, 255); //Will generate a random number beetwen 200 to 255
int R = Rand.Next(0, 255); //Will generate a random number beetwen 0 to 255
int G = Rand.Next(0, 255); //Will generate a random number beetwen 0 to 255
int B = Rand.Next(0, 255); //Will generate a random number beetwen 0 to 255


A it's the opacity of the label (0 = None, 255 = Full) So i recommended to use a number beetwen 200 to 255 so the label will be visible enough to understand.
Next just put the label name color
    YourLabel.ForeColor =  Color.FromArbg(A,R,G,B);

You can change the numbers of the random numbers to whatever you like, than it will generate other colors
Make sure you put the Random definition outside of the timer void loop (So it will be global variable) than it wont need to make a new definition of the Random everytime that the loop ends.


Haha your right my bro, the thing is i know how to do it now anyways xD but thanks bro

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo