使屏幕闪烁/闪烁,以提醒用户 [英] Make a screen blink / flash to alert user

查看:223
本文介绍了使屏幕闪烁/闪烁,以提醒用户的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用.NET 3.5的WinForms,我怎么会做红色和白色之间。在那一瞬间,整个屏幕闪烁/闪烁。

Using .NET 3.5 Winforms, How would i make the entire screen flash/blink between red and white for just a second.

我有一个大屏幕的只是为了显示在监视设备状态。我想它以Flash为用户通知当事件发生时,他们应该看。

I have a big screen that's only meant to show status on monitored equipment. I would like it to flash as a notification to users when an event occurs that they should be looking at.

感谢您

推荐答案

使用曾建议什么tbischel。下面是一些示例code定时器。

Use what tbischel has suggested. Here is some sample code for the 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

这将红,白和任何间隔你指定你的定时器之间交替。你给怎么过多少秒之后它就会停止。当它完成它设置颜色为灰色,删除.TopMost标志,并设置将WindowState恢复正常。

It will alternate between Red and White and whatever interval you specify for your timer. It will stop after how ever many seconds you give it. When it is done it sets the color to grey, removes the .TopMost flag and sets the WindowState back to normal.

说了这么多,这真是烦人:)

Having said that; it's really annoying :)

这篇关于使屏幕闪烁/闪烁,以提醒用户的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆