Make the screen blink / flash to alert the user

Using .NET 3.5 Winforms, How to make the whole screen flash / blink between red and white for a second.

I have a large screen that is only intended to display status on monitored equipment. I would like it to blink as a notification to users when an event occurs that they should be looking at.

thanks

+4
source share
2 answers

Use what tbischel suggested. Here is a sample code for a timer.

Private TickCount As Integer = 0 Private Const NUMBER_OF_SECONDS As Integer = 1 Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick Me.BackColor = If(Me.BackColor = Color.White, Color.Red, Color.White) TickCount += 1 If TickCount >= NUMBER_OF_SECONDS * 1000 / Timer1.Interval Then Timer1.Stop() Me.BackColor = Color.Gray Me.TopMost = False Me.WindowState = FormWindowState.Normal End If End Sub 

It will alternate between red and white and at any interval set for your timer. It will stop after all the many seconds you give it. When this is done, it sets the color to gray, removes the .TopMost flag, and returns the WindowState to its normal state.

Having said that; it is really annoying :)

+3
source

you can create a blank maximized form using the FormBorderStyle parameter set to FormBorderStyle.None and set the background color to a timer.

+2
source

All Articles