首页 > 其他 > 详细

设置闪烁的标题栏

时间:2018-12-11 14:19:00      阅读:146      评论:0      收藏:0      [点我收藏+]

实现效果:

  技术分享图片

知识运用:

  用到了API函数的FlashWindow

  [System.Runtime.InteropServices.DllImportAttribute("user32_.dll")]

  public static extern bool FlashWindow(IntPtr handle,bool bInvert);

  //handle: 表是要闪烁的窗体  bInvert: 是否恢复状态

实现代码:

        //重写API函数 用来实现标题栏的闪烁功能
        [System.Runtime.InteropServices.DllImportAttribute("user32.dll")]
        public static extern bool FlashWindow(IntPtr handle,bool bInvert);
        private void timer1_Tick_1(object sender, EventArgs e)
        {
            FlashWindow(this.Handle, true);     //启动窗体闪烁函数
        }
        private void button1_Click(object sender, EventArgs e)
        {
            timer1.Enabled = true;          //启动计时器
        }
        private void button2_Click(object sender, EventArgs e)
        {
            timer1.Enabled = false;         //关闭计时器
        }

 

设置闪烁的标题栏

原文:https://www.cnblogs.com/feiyucha/p/10101732.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!