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);

}

}
}

时间: 2024-08-24 10:07:47

C# STUDY的相关文章

SHELL STUDY....tr的用法

一般我们使用tr来做字符串的替换,或者删除指定的字符串 tr的语法如下: tr [OPTION]... SET1 [SET2] -c, -C, --complement first complement SET1 将非SET1中的字符替换为SET2 [[email protected] ~]$ echo "lubinsu" | tr -c "l" "A" lAAAAAAA -d, --delete delete characters in SET

Oracle Study之--Oracle等待事件(1)

Oracle Study之--Oracle等待事件(1) 一. 等待事件的相关知识1.1 等待事件主要可以分为两类: 即空闲(IDLE)等待事件和非空闲(NON-IDLE)等待事件.1). 空闲等待事件指ORACLE正等待某种工作,在诊断和优化数据库的时候,不用过多注意这部分事件.2). 非空闲等待事件专门针对ORACLE的活动,指数据库任务或应用运行过程中发生的等待,这些等待事件 是在调整数据库的时候需要关注与研究的.在Oracle 10g中的等待事件有874个,11g中等待事件1118个.

MySQL Study之--MySQL下图形工具的使用(phpMyAdmin)

MySQL Study之--MySQL下图形工具的使用(phpMyAdmin) 系统环境: RedHat EL6 数据库:  MySQL 5.6.4-m7 phpMyAdmin是一个用PHP编写的软件工具,是以PHP为基础,以Web-Base方式架构在网站主机上的MySQL的数据库管理工具,让管理者可用Web接口管理MySQL数据库.借由此Web接口可以成为一个简易方式输入繁杂SQL语法的较佳途径,尤其要处理大量资料的汇入及汇出更为方便.其中一个更大的优势在于由于phpMyAdmin跟其他PHP

MySQL Study之--MySQL体系结构深入解析

MySQL Study之--MySQL体系结构深入解析 MySQL体系架构 由连接池组件.管理服务和工具组件.sql接口组件.查询分析器组件.优化器组件.缓冲组件.插件式存储引擎.物理文件组成.mysql是独有的插件式体系结构,各个存储引擎有自己的特点. MySQL内存结构: Mysql 进程结构 Mysql不像oracle那样是通过多进程来完成其功能的.默认情况下,InnoDB存储引擎的后台线程有7个: 4个IO thread, 1个master thread, 1个锁(lock)监控线程,

MySQl Study学习之--MySQl二进制日志管理

MySQl Study学习之--MySQl二进制日志管理 MySQL二进制日志(Binary Log):   a.它包含的内容及作用如下:    包含了所有更新了数据或者已经潜在更新了数据(比如没有匹配任何行的一个DELETE)    包含关于每个更新数据库(DML)的语句的执行时间信息    不包含没有修改任何数据的语句,如果需要启用该选项,需要开启通用日志功能    主要目的是尽可能的将数据库恢复到数据库故障点,因为二进制日志包含备份后进行的所有更新    用于在主复制服务器上记录所有将发送

Study ExtJS 4.x

Before we start: 1.  All my knowledge comes from Internet and I will try my best to present the reference link. 2.  I would be glad if u could join me with the same topic. 3.  I am green hand, really.. 4.  never code for u , u code for urself.(I give

Oracle Study之案例--异构平台传输表空间(Linux至AIX)

Oracle Study之案例--异构平台传输表空间(Linux至AIX) 系统架构: 可                   源    库               目标库 操作系统 Linux RH6    AIX 5.3-09 主机名 rh6(192.168.8.245) aix211(192.168.8.211) 数据版本 Oracle 11gR2 Oracle 11gR2 数据库名 prod orcl 表空间 test1 test1    可传输表空间概述 Oracle 的可传输表空

Oracle Study之--Oracle等待事件(5)

Oracle Study之--Oracle等待事件(5)  Db file single write这个等待事件通常只发生在一种情况下,就是Oracle 更新数据文件头信息时(比如发生Checkpoint).当这个等待事件很明显时,需要考虑是不是数据库中的数据文件数量太大,导致Oracle 需要花较长的时间来做所有文件头的更新操作(checkpoint).这个等待事件有三个参数:File#: 需要更新的数据块所在的数据文件的文件号.Block#: 需要更新的数据块号.Blocks: 需要更新的数

C++ Primer Study Note 系列[1]-chapter1快速入门

I want to study it all the time , and now I am ready to study this book in the next mouth. Time : 2014/07/02 先看一个程序体验一下: #include <iostream> int main() {     /*This is a test example*/     std::cout << "Enter two numbers:" << s

Oracle Study之-AIX6.1构建Oracle 10gR2 RAC(3)

Oracle Study之-AIX6.1构建Oracle 10gR2 RAC(3) 一.配置共享存储 [[email protected] ~]$lsdev -c disk hdisk0 Available 1S-08-00-8,0 Other SCSI Disk Drive hdisk1 Available 1D-08-02     Other FC SCSI Disk Drive [[email protected] /]#lsdev -c disk hdisk0 Available 1S-