现在的位置: 首页 > 综合 > 正文

闪烁动画窗体

2013年05月04日 ⁄ 综合 ⁄ 共 429字 ⁄ 字号 评论关闭

利用两个Timer控件,实现窗体中的图片闪烁的效果

 

实现步骤 :

一、窗体中添加两个Timer控件,分别设置事件频率

二、在窗体中添加pictureBox控件,添加图片(骷髅头效果更好哦,哈哈)

二、在timer1下编写代码

Code:
  1. //将图片隐藏   
  2. this.pictureBox1.Visible = false;   
  3. //关闭当前timer控件,启动timer2控件   
  4. this.timer1.Enabled = false;   
  5. this.timer2.Enabled = true;  

       在timer2下编写代码

Code:
  1. //将图片显示   
  2. this.pictureBox1.Visible = true;   
  3. //关闭当前timer控件,启动timer1   
  4. this.timer2.Enabled = false;   
  5. this.timer1.Enabled = true;   

三、在窗体加载时间中启动其中一个timer控件即可

注:纯属皮毛,仅供娱乐 哈哈

抱歉!评论已关闭.