窗体的闪烁---用不断刷新实现
2009-10-27 10:50
176 查看
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace Case01_4
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
//声明FlashWindow函数
[System.Runtime.InteropServices.DllImportAttribute("user32.dll")]
public static extern bool FlashWindow(IntPtr handle, bool bInvert);
private void Form1_Load(object sender, EventArgs e)
{
this.timer1.Enabled = true;
this.timer1.Interval = 500;
this.timer2.Enabled = false;
this.timer2.Interval = 260;
}
private void timer1_Tick(object sender, EventArgs e)
{
FlashWindow(this.Handle, true);
pictureBox1.Visible = true;
timer1.Enabled = false;
timer2.Enabled = true;
}
private void timer2_Tick(object sender, EventArgs e)
{
FlashWindow(this.Handle, true);
pictureBox1.Visible = false;
timer2.Enabled = false;
timer1.Enabled = true;
}
}
}
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace Case01_4
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
//声明FlashWindow函数
[System.Runtime.InteropServices.DllImportAttribute("user32.dll")]
public static extern bool FlashWindow(IntPtr handle, bool bInvert);
private void Form1_Load(object sender, EventArgs e)
{
this.timer1.Enabled = true;
this.timer1.Interval = 500;
this.timer2.Enabled = false;
this.timer2.Interval = 260;
}
private void timer1_Tick(object sender, EventArgs e)
{
FlashWindow(this.Handle, true);
pictureBox1.Visible = true;
timer1.Enabled = false;
timer2.Enabled = true;
}
private void timer2_Tick(object sender, EventArgs e)
{
FlashWindow(this.Handle, true);
pictureBox1.Visible = false;
timer2.Enabled = false;
timer1.Enabled = true;
}
}
}
相关文章推荐
- winform下实现Label在窗体中从右到左不断循环的动画效果
- delphi实现窗体闪烁功能
- 用ajax技术实现无闪烁定时刷新页面
- 用ajax技术实现无闪烁定时刷新页面
- JS实现刷新:在窗体打开或者关闭的时候使用
- ASP.NET利用JavaScript实现无刷新闪烁二级联动菜单
- Ajax实现无闪烁定时刷新页面实例代码
- AJAX ModalPopupExtender实现弹出窗体效果 结合UpdatePanel实现完全无刷新
- 用委托实现B窗体刷新A窗体
- ASP.NET利用JavaScript实现无刷新闪烁二级联动菜单
- ASP.NET利用JavaScript实现无刷新闪烁二级联动菜单
- 实现网页图片不断闪烁
- jQuery实现不断闪烁文字的方法
- Asp.net中实现刷新父窗体
- Winform中如何实现子窗体刷新父窗体
- C#实现winform用子窗体刷新父窗体及子窗体改变父窗体控件值的方法
- 如何在子窗体(被调用者)中实现对其父窗体(调用者)的刷新
- Asp.net中实现刷新父窗体
- 基于Vue实现tab栏切换内容不断实时刷新数据功能
- php+ajax 实现web页面无闪烁刷新 页面前端和后端交互