您的位置:首页 > 编程语言 > C#

C#实现一个矩形不断向下延伸完整源程序

2009-03-11 21:01 267 查看
private void Form1_Paint(object sender, PaintEventArgs e)
{
Graphics g = e.Graphics;
int second = DateTime.Now.Second;
SolidBrush brush = new SolidBrush(Color.Blue);
Pen pen = new Pen(Color.Blue);
g.FillRectangle(brush, 100, 20, 30, second );
}
private void timer1_Tick(object sender, EventArgs e)
{
this.Refresh();
}

//timer的Enabled属性为ture;

//设置窗体的doublebuffer为true

…………类似可以实现指针时钟动画,具体请到博客(http://download.csdn.net/user/shuanghusun)下载,包含部分源代码及.exe文件.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: