By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
458,173 Members | 1,686 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 458,173 IT Pros & Developers. It's quick & easy.

Making a control flash

P: n/a
I want to deliberately make a label (and perhaps a button) flash to
alert the user that something very serious has happened.

Any ideas on how to do this?
Nov 15 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
without stating my opinion on blinking things in a UI...

Add a timer control to your form and then whenever you want it to start
blinking, set it's enabled property to true. In the timer's tick event, set
it to visible if visible is false and set visible to false if it's true.
You can use a Static module level variable and just set the visible property
to the boolean variable....and just change the bool's value with each tick.

HTH,

Bill
"Mystery Man" <Pr************@hotmail.com> wrote in message
news:87*************************@posting.google.co m...
I want to deliberately make a label (and perhaps a button) flash to
alert the user that something very serious has happened.

Any ideas on how to do this?

Nov 15 '05 #2

P: n/a
I'd recommend rather than toggling the visibility, toggling the enabled state,
that way it flashes from black to gray to black, similar effect, but the text
is always visible.

No need to store the state separately, just use the following:

label.Enabled = !label.Enabled;

in response to the timer event.

William Ryan eMVP wrote:

without stating my opinion on blinking things in a UI...

Add a timer control to your form and then whenever you want it to start
blinking, set it's enabled property to true. In the timer's tick event, set
it to visible if visible is false and set visible to false if it's true.
You can use a Static module level variable and just set the visible property
to the boolean variable....and just change the bool's value with each tick.

HTH,

Bill
"Mystery Man" <Pr************@hotmail.com> wrote in message
news:87*************************@posting.google.co m...
I want to deliberately make a label (and perhaps a button) flash to
alert the user that something very serious has happened.

Any ideas on how to do this?


--
Bret Pehrson
mailto:br**@infowest.com
NOSPAM - Include this key in all e-mail correspondence <<38952rglkwdsl>>
Nov 15 '05 #3

P: n/a
Bret:

Good points, and yes, there are multiple properties that you can manipulate
to create a blinking effect. Personally, I tend to use the approach you
mention setting the property to it's opposite when state can only be one of
two conditions. However, I have run into occassions where the behavior
might need to be temporarily changed and other properties may need to be
changed based on that change, hence the module level variable. I think for
this issue though, your approach is definitely cleaner.

Cheers,

Bill
"Bret Pehrson" <br**@infowest.com> wrote in message
news:40***************@infowest.com...
I'd recommend rather than toggling the visibility, toggling the enabled state, that way it flashes from black to gray to black, similar effect, but the text is always visible.

No need to store the state separately, just use the following:

label.Enabled = !label.Enabled;

in response to the timer event.

William Ryan eMVP wrote:

without stating my opinion on blinking things in a UI...

Add a timer control to your form and then whenever you want it to start
blinking, set it's enabled property to true. In the timer's tick event, set it to visible if visible is false and set visible to false if it's true.
You can use a Static module level variable and just set the visible property to the boolean variable....and just change the bool's value with each tick.
HTH,

Bill
"Mystery Man" <Pr************@hotmail.com> wrote in message
news:87*************************@posting.google.co m...
I want to deliberately make a label (and perhaps a button) flash to
alert the user that something very serious has happened.

Any ideas on how to do this?


--
Bret Pehrson
mailto:br**@infowest.com
NOSPAM - Include this key in all e-mail correspondence <<38952rglkwdsl>>

Nov 15 '05 #4

P: n/a
If that serious thing is some erroneous input use the Error provider class
that is the standard way of doing making a alert.

Nirosh.

"Mystery Man" <Pr************@hotmail.com> wrote in message
news:87*************************@posting.google.co m...
I want to deliberately make a label (and perhaps a button) flash to
alert the user that something very serious has happened.

Any ideas on how to do this?

Nov 15 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.