using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;namespace _03气泡_续续集
{public partial class Form1 : Form{public Form1(){InitializeComponent();}Label lb = new Label();Timer time = new Timer();private void Form1_Load(object sender, EventArgs e){this.WindowState = FormWindowState.Maximized;this.FormBorderStyle = FormBorderStyle.None;lb.Text = "一屉热乎乎的小笼包";lb.Font = new Font("楷体",30);lb.AutoSize = true;this.Controls.Add(lb);time.Interval = 1;time.Start();time.Tick += Time_Tick;}int x = 5;int y = 5;private void Time_Tick(object sender, EventArgs e){lb.Left = lb.Left + x;lb.Top = lb.Top + y;if (x>0 && y>0){if (lb.Top+lb.Height>=Screen.PrimaryScreen.WorkingArea.Height){x = 5;y = -5;}if (lb.Left+lb.Width>=Screen.PrimaryScreen.Bounds.Width){x = -5;y = 5;}}if (x>0 && y<0){if (lb.Left+lb.Width>=Screen.PrimaryScreen.Bounds.Width){x = -5;y = -5;}if (lb.Top<=0){x = 5;y = 5;}}if (x<0 && y<0){if (lb.Top<=0){x = -5;y = 5;}if (lb.Left<=0){x = 5;y = -5;}}if (x<0 && y>0){if (lb.Left <= 0){x = 5;y = 5;}if (lb.Top + lb.Height >= Screen.PrimaryScreen.WorkingArea.Height){x = -5;y = -5;}}}}
}

C#实现气泡屏保效果(用1个timer)相关推荐

  1. php气泡效果,js 模拟气泡屏保效果代码_其他特效

    核心代码: var T$ = function(id) { return document.getElementById(id); } var $extend = function(des, src) ...

  2. C#实现气泡屏保效果(用4个timer)

    using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; usin ...

  3. 用JavaScript写一个类似于windows的气泡屏保效果

    最近在学习JavaScript,然后在书上看到了一个简单的碰壁反弹效果,效果你们可以看一下,js代码如下: window.onload = function(){var main = document ...

  4. [ActionScript 3.0] 模拟win7彩色气泡屏保效果

    主文件: package {import com.views.BubbleView;import com.views.ColorfulBubble;import flash.display.Sprit ...

  5. C#实现气泡屏保(四个timer实现)

    四个timer实现气泡屏保 using System; using System.Collections.Generic; using System.ComponentModel; using Sys ...

  6. c#第二课,气泡屏保

    回顾 属性赋值(4种) (1)直接赋值语法:15种数据类型 整数(8种) int uint short ushort long ulong- 浮点型(3种)double float decimal 布 ...

  7. C#实现气泡屏保(1个timer实现)

    using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; usin ...

  8. Winform中实现自定义屏保效果(附代码下载)

    场景 效果 注: 博客主页: https://blog.csdn.net/badao_liumang_qizhi 关注公众号 霸道的程序猿 获取编程相关电子书.教程推送与免费下载. 实现 新建form ...

  9. 【JavaGUI demo】swing仿Windows气泡屏保动画(含源码)

    概述 java实现简单泡泡屏保动画及点击变实心泡泡,空格暂停动画 实现思路 采用MVC(Model-View-Controller(模型-视图-控制器))设计思路.将数据层与视图层与控制层分开. 在本 ...

最新文章

  1. 在大数据时代,每家公司都要有大数据部门吗?
  2. 程序员的一个好习惯,你有几个?
  3. python3.7是什么_Python 3.7 有什么新变化
  4. 让电脑说话代码_让您的代码为您说话
  5. Flutter布局锦囊---完善信息页
  6. Unicode Tips
  7. halcon学习之图像分割
  8. 轻量级java开发工具_C++主流开发工具推荐
  9. POJ2063 Investment(完全背包)
  10. (004)每日SQL学习:物化视图之二
  11. PeakDo毫米波无线投屏器,你的无线图传神器
  12. google已经启用www.guge.com(谷歌)域名
  13. Xcode6 安装 IOS7.1 Simulator
  14. 敏捷下的scrim、xp、3355、TDD、BDD、CI、DI及四个仪式、十二原则汇总
  15. 基于微信小程序的自习室预约系统设计与实现-计算机毕业设计源码+LW文档
  16. 一文详解IMU模型原理和标定选型
  17. 电脑什么软件都没开,运行内存就占满了
  18. CAN与CANOpen(一)
  19. 英语题目作业(12)
  20. 多国语言在线客服系统源码+软件下载二合一集成

热门文章

  1. [bzoj 4808]马
  2. 在乐视2手机上解决kindle阅读器即译时音标显示正常的问题
  3. dll依赖查看工具Depends
  4. IT人形象(装笔)管理指南
  5. 网络安全卷么? 你身边的网络安全人过的怎么样呢?
  6. Manacher Algorithm马拉车算法详解
  7. node+koa+canvas绘制出货单,收据,票据
  8. vue音乐笔记_Vue音乐项目笔记(三)
  9. 教你用C++ ChatRoom(CSocket)原理实现聊天室,附开源源码
  10. 基于Matlab的汽车安全应用轨道融合仿真(附源码)