473,396 Members | 1,891 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Making a control flash

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
4 5855
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Ron Vecchi | last post by:
Hello, Through using this and many other Microsoft dotnet newsgroups I have been pointed towards many helpful open source projects and articles that have helped a great deal in my studies as...
2
by: Alex Maghen | last post by:
I want to insert (or not insert) a Macromedia Flash object on my ASP.NET .ASPX page. What is the most elegant way of doing this? I know that I could use an <ASP:Literal> control and just spit the...
0
by: BobAchgill | last post by:
Do I use forms or controls to accomplish layers 2 and 3??? The scenario is this: Layer 1 (on bottom) is a web client control in my base Form. Now I want to temporarily over lay the web...
2
by: rhungund | last post by:
Hi all. I have a user control I'm using as my "include" file for my flash navigation. My asp.net app is written in vb.net. The swf file takes a parameter which I would like to pass into my user...
1
by: Haobing | last post by:
I embeded an flash activex control to a wxPanel inherited class 'MyPanel' using wxPython's MakeActiveXClass method, and 'MyPanel' only has flash control ;But when then dialog init,the focus is not...
351
by: CBFalconer | last post by:
We often find hidden, and totally unnecessary, assumptions being made in code. The following leans heavily on one particular example, which happens to be in C. However similar things can (and...
1
by: Priya | last post by:
Hi , I'm creating a custom control for a web project. I wanted to add flash content as part of that control. How do i do that in C# file. Pls help. Thanks in advance, Priya
3
by: VMI | last post by:
What are the advantages/disadvantages of using the Flash component on my screensaver application? The basic animation that the screensaver will include can be done either with Flash or by writing...
3
by: vinceboy | last post by:
Hi..guys.I am newbie here and have a page which need to load two different flash element with session control.However something went wrong in the code and cause the first if clause is not working.I...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.