zoukankan      html  css  js  c++  java
  • 设置闪烁的标题栏

    实现效果:

      

    知识运用:

      用到了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;         //关闭计时器
            }
    
  • 相关阅读:
    站立会议第八天
    Servlet基础知识
    JSP基础知识
    JSP基础知识
    JDBC工具包
    JDBC
    MySQL
    ASP.NET程序代码优化的七个方面
    中小型软件项目开发一般流程建议
    理解九种图
  • 原文地址:https://www.cnblogs.com/feiyucha/p/10101732.html
Copyright © 2011-2022 走看看