当前位置:编程学习 > C#/ASP.NET >>

C#窗体移动

如何用一个timer控制窗体移动? --------------------编程问答-------------------- 为什么要用timer控制窗体移动?

--------------------编程问答-------------------- 设定控件坐标,让然后在timer事件下,加减坐标值。窗体不能移吧。 --------------------编程问答--------------------
using System;
using System.Windows.Forms;

namespace WindowsFormsApplication1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
            Timer t = new Timer();
            t.Interval = 500;
            t.Tick += new EventHandler((s, e) => { Top+=5; Left+=5; });
            t.Enabled = true;
        }

    }
}
补充:.NET技术 ,  C#
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,