C# STUDY
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 WindowsFormsApplication3
{
public partial class Form1 : Form
{
public delegate void TimerHandler();
public event TimerHandler m_TimerEvent;
public int m_offset;
private System.Timers.Timer m_timer;
private List<System.Drawing.Point> m_orinLocation;
private List<System.Windows.Forms.Button> m_Buttons;
public Form1()
{
InitializeComponent();
m_timer = new System.Timers.Timer(50);
m_timer.Elapsed += new System.Timers.ElapsedEventHandler(theout);
m_timer.Enabled = true;
m_orinLocation = new List<System.Drawing.Point>();
m_Buttons = new List<System.Windows.Forms.Button>();
m_orinLocation.Add(button1.Location);
m_orinLocation.Add(button2.Location);
m_orinLocation.Add(button3.Location);
m_orinLocation.Add(button4.Location);
m_orinLocation.Add(button5.Location);
m_orinLocation.Add(button6.Location);
m_orinLocation.Add(button7.Location);
m_orinLocation.Add(button8.Location);
m_orinLocation.Add(button9.Location);
m_Buttons.Add(button1);
m_Buttons.Add(button2);
m_Buttons.Add(button3);
m_Buttons.Add(button4);
m_Buttons.Add(button5);
m_Buttons.Add(button6);
m_Buttons.Add(button7);
m_Buttons.Add(button8);
m_Buttons.Add(button9);
m_offset = 0;
m_TimerEvent += process;
}
public void process()
{
m_timer.Enabled = false;
int itemHeight = this.button1.Height;
System.Console.WriteLine("Process m_offset{0}, mod{1}", m_offset, m_offset % itemHeight);
m_offset += itemHeight / 2;
if (m_offset >= itemHeight)
{
m_offset = 0;
for (int i = 0; i < 9; ++i)
{
m_Buttons[i].Location = new System.Drawing.Point(m_orinLocation[i].X, m_orinLocation[i].Y);
}
}
else
{
for (int i = 0; i < 9; ++i)
{
m_Buttons[i].Location = new System.Drawing.Point(m_orinLocation[i].X, m_orinLocation[i].Y - m_offset);
}
}
m_timer.Enabled = true;
}
public void theout(object source, System.Timers.ElapsedEventArgs e)
{
try
{
if (m_TimerEvent != null)
this.Invoke(m_TimerEvent);
}
catch(System.Exception err)
{
Console.WriteLine("{0}",err.Message);
}
}
private void button10_Click(object sender, EventArgs e)
{
}
protected override void OnClosing(CancelEventArgs e)
{
m_timer.Stop();
m_timer.Close();
m_TimerEvent = null;
}
protected override void OnPaint(PaintEventArgs e)
{
base.OnPaint(e);
}
}
}
C# STUDY的更多相关文章
- Improve Your Study Habits
1.Plan your time carefully. Make a list of your weekly tasks.Then make a schedule or chart of your t ...
- RSA Study
These days I study the RSA Algorithm. It is a little complex, but not very. Also, my study has not f ...
- Machine Learning Algorithms Study Notes(3)--Learning Theory
Machine Learning Algorithms Study Notes 高雪松 @雪松Cedro Microsoft MVP 本系列文章是Andrew Ng 在斯坦福的机器学习课程 CS 22 ...
- Machine Learning Algorithms Study Notes(2)--Supervised Learning
Machine Learning Algorithms Study Notes 高雪松 @雪松Cedro Microsoft MVP 本系列文章是Andrew Ng 在斯坦福的机器学习课程 CS 22 ...
- Machine Learning Algorithms Study Notes(1)--Introduction
Machine Learning Algorithms Study Notes 高雪松 @雪松Cedro Microsoft MVP 目 录 1 Introduction 1 1.1 ...
- jar tvf study.war jar命令查看war/jar包的内容
jar tvf study.war 0 Thu Oct 20 14:01:18 CST 2016 META-INF/ 137 Thu Oct 20 14:01:16 CST 2016 META-INF ...
- Mongo DB Study: first face with mongo DB
Mongo DB Study: first face with mongo DB 1. study methods: 1. Translate: I am the mongo DB organiz ...
- A Study of WebRTC Security
转自:http://webrtc-security.github.io/ A Study of WebRTC Security Abstract Web Real-Time Communication ...
- study topics
永远不变的东西,原理 study roadmap: 1.user space: tizen power manager => suspend/resume or runtime? android ...
- 读书笔记2013第10本:《学得少却考得好Learn More Study Less》
<学得少却考得好Learn More Study Less>这本书最早是从褪墨网站上看到的,crowncheng翻译了全文.这本书介绍了不少学习方法,非常适合在校的学生,原文的作者Scot ...
随机推荐
- 转:db2 iptables相关用法(1)
如果你的IPTABLES基础知识还不了解,建议先去看看. 开始配置 我们来配置一个filter表的防火墙. (1)查看本机关于IPTABLES的设置情况 [root@tp ~]# iptables - ...
- liunx之:rpm包安装
使用rpm命令查询软件包: 1.查询系统中安装的所有RPM包 $ rpm -qa 查询当前linux系统中已经安装的软件包. 例:$ rpm -qa | grep -i x11 | head -3 察 ...
- 谓词的使用 -ios
#import <Foundation/Foundation.h> @interface Person : NSObject<NSCopying> @property(nona ...
- Android Facebook和Twitter分享
1. 背景 在年初的时候,公司的项目有个新的需求,在英文版的应用中加入Facebook和Twitter分享功能. 2. 完成情况 由于这个项目比较急,所以开发这个功能从预研到接入总共耗时一周.后来,在 ...
- IIS用户权限备忘
经常在网站部署到IIS遇到IIS帐户没有权限的问题,总是在看IIS Admin Service,但发现些帐户是有权限的. 其实针对相应的站点,应该看的是Application Pool的运行帐户,这个 ...
- @Resource注解
原文地址:http://blog.sina.com.cn/s/blog_a795a96f01016if1.html @Resource 注解被用来激活一个命名资源(named resource)的 ...
- 【C语言模拟实现】浮点数-转-定点数
要想超神,就要什么都精! 知识准备: 1. 输出浮点数的十六进制形式?(利用指针输出) 将浮点数指针-转换成-整型指针,以十六进制的格式输出指针内容. 示例程序: #include<stdio. ...
- web压力测试 - http_load
http_load是基于linux平台的一个性能测工具 非常小巧易用,可以用并行方式运行,来测试web服务器的性能 测试方式 (1)准备测试url vim url.txt 填写要测试的url,可以写多 ...
- Oracle监控代理安装ITM(IBM Tivoli Monitoring)
1 监控代理安装 2 1.1 安装 2 1.1.1 解压安装包 2 1.1.2 安装 2 1.2 配置 5 1.2.1 给Agent授权 5 1.2.2 配置Oracle Agent 10 目录 1 ...
- Hadoop学习地址
hortonworks: http://zh.hortonworks.com/hdp/downloads/ http://zh.hortonworks.com/hadoop-tutorial/supe ...