实现效果:

  

知识运用:

  Form类的Left和Top属性

实现代码:

        private void timer1_Tick(object sender, EventArgs e)
{
Rectangle rec = Screen.GetWorkingArea(this);
if ((rec.Width - this.Width) != this.Left)
{
this.Left++;
this.Top += 1;
}
else
{
timer1.Enabled = false;
timer2.Enabled = true;
}
} private void timer2_Tick(object sender, EventArgs e)
{
Rectangle rec = Screen.GetWorkingArea(this);
if (this.Left ==0)
{
timer2.Enabled = false;
timer1.Enabled = true;
}
else
{
this.Left--;
this.Top -= 1;
}
}

使用Timer组件制作左右飘动的窗体的更多相关文章

  1. 使用Timer组件_实现定时更改窗体颜色

    1 向窗体拖入Timer组件 2 更改其Enable属性为true 3 其interval属性为300 4 在Tick事件中写入随机变色代码 private void timer1_Tick(obje ...

  2. 使用Timer组件制作计时器

    实现效果: 知识运用: Timer组件的interval属性 //获取或设置Timer组件Tick事件发生的时间间隔 public int Interval {get;set} NumericUpDo ...

  3. Timer组件

    1.常用属性 Interval 用于获取或设置Timer组件Tick事件发生的时间间隔,属性值不能小于1 制作左右飘摇窗体 private void timer1_Tick(object sender ...

  4. 编写Java程序,使用菜单组件制作一个记事本编辑器

    返回本章节 返回作业目录 需求说明: 使用菜单组件制作一个记事本编辑器 实现思路: 创建记事本菜单工具栏JMenuBar. 创建多个菜单条JMenu. 创建多个菜单项JMenuItem. 将菜单添加至 ...

  5. 使用Timer组件实现倒计时

    实现效果: 知识运用:  Timer组件的Enabed属性 实现代码: private void timer1_Tick(object sender, EventArgs e) { DateTime ...

  6. 使用ImageList组件制作动画图片

    实现效果: 知识运用: Timer组件的Enabled属性  Tick事件 PictureBox控件的Image属性 ImageList组件的Images属性 实现代码: private void F ...

  7. Flutter实战视频-移动电商-13.首页_广告Banner组件制作

    13.首页_广告Banner组件制作 主要是做这个小广告条. 其实就是读取一个图片做一个widget放到这里 使用stlessW快速生成 定义一个变量存放图片的url地址: 这样我们的广告条就写完了 ...

  8. ReactNative: 将自定义的ReactNative组件制作成第三方库的详细流程(制作-->发布)

    一.简介 在讲本篇博文之前,需要你熟知怎么自定义ReactNative组件,然后才好学习将自定义的ReactNative组件制作成第三方库.本文中的自定义的ReactNative组件LoginMana ...

  9. DevExpress - 使用 GaugeControl 标尺组件制作抽奖程序 附源码

    前不久,公司举办了15周年庆,其中添加了一个抽奖环节,要从在读学员中随机抽取幸运学员,当然,这个任务就分到了我这里. 最后的效果如下,启动有个欢迎页面,数据是来自Excel的,点击开始则上面的学号及姓 ...

随机推荐

  1. HDU - 2962 Trucking SPFA+二分

    Trucking A certain local trucking company would like to transport some goods on a cargo truck from o ...

  2. CABasicAnimation动画及其keypath值和作用

    //tarnsform放大缩小动画 CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:@"transf ...

  3. EditText 设置可以输入的字符,过滤不符合接口要求的数据的方法

    1.设置EditText的android:digits 属性, 这种方式可以指出要支持的字符.比如要限制只能输入数字和字母,可以这样android:digits="1234567890ABC ...

  4. ubuntu18.04中mysql的安装及远程连接配置

    1.ubuntu 18.04 下mysql的安装 sudo apt install mysql-server 2.mysql 安装配置 sudo mysql_secure_installation 参 ...

  5. Arrange the Bulls

    题目链接 #include <stdio.h> #include <algorithm> #include <string.h> #include <iost ...

  6. Table 自定义设置边框线

    table上添加:border-collapse: collapse;//设置表格边框分开显示就可以设置tr td的边框线

  7. Sicily 1027. MJ, Nowhere to Hide

    //就是一个简单的字符串配对~~用map来解决很easy #include <iostream> #include <map> #include <string> ...

  8. Net Core 2.0生态1

    Net Core 2.0生态 阅读目录 前言:答读者问(time by:2017.8.19) 项目升级到ASP.NET Core 2.0 新增功能:Razor Pages介绍 模板更新 Entity ...

  9. 转 event 'utl_file I/O':

    The ASH report shows tables and data files with wait event 'utl_file I/O': CHANGES No changes. CAUSE ...

  10. Maven--setting详解

    settings.xml有什么用? 如果在Eclipse中使用过Maven插件,想必会有这个经验:配置settings.xml文件的路径. settings.xml文件是干什么的,为什么要配置它呢? ...