求c#时钟源代码   谢谢

解决方案 »

  1.   

    http://www.cnpopsoft.com/article.asp?id=53
      

  2.   

    首先导入timer 将其Interval 属性值改为1000
    再点击timer的Tick 事件   private void timer1_Tick(object sender, EventArgs e)
            {
                this.toolStripStatusLabel2.Text = "当前时间:" + DateTime.Now.ToString();        }
      

  3.   

    代码如下:
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Windows.Forms;namespace 运行的时钟
    {
        public partial class Form1 : Form
        {
            const int s_pinlen = 100;
            const int m_pinlen = 75;
            const int h_pinlen = 50;
            public Form1()
            {
                InitializeComponent();
            }        private void pictureBox1_Click(object sender, EventArgs e)
            {        }
            public void myClock(int h, int m, int s)
            {
                Graphics myGraphics = pictureBox1.CreateGraphics();
                myGraphics.Clear(Color .White );
                Pen mypen = new Pen(Color .Black ,1);
                myGraphics.DrawEllipse(mypen ,pictureBox1 .ClientRectangle);
                Point CPoint = new Point(pictureBox1 .ClientRectangle .Width /2,pictureBox1 .ClientRectangle .Height /2);            Point SPoint = new Point((int)(CPoint .X +(Math .Sin(6*s*Math .PI /180))* s_pinlen),(int)(CPoint .Y -(Math .Cos (6*s *Math .PI /180))*s_pinlen));            Point MPoint = new Point((int )(CPoint .X +(Math .Sin (6*m*Math .PI /180))*m_pinlen),(int )(CPoint .Y -(Math.Cos (6*m*Math .PI /180))*m_pinlen ));            Point HPoint = new Point((int)(CPoint.X + (Math.Sin(((30*h)+(m/2))*Math .PI /180))*h_pinlen),(int)(CPoint .Y -(Math .Cos (((30*h)+(m/2))*Math .PI /180))*h_pinlen));            myGraphics.DrawLine(mypen ,CPoint ,SPoint );
                mypen = new Pen(Color .Black ,2);
                myGraphics.DrawLine(mypen ,CPoint ,MPoint );
                mypen = new Pen(Color .Black ,4);
                myGraphics.DrawLine(mypen ,CPoint ,HPoint );
            }        private void timer1_Tick(object sender, EventArgs e)
            {
                int h = DateTime.Now.Hour;
                int m = DateTime.Now.Minute;
                int s = DateTime.Now.Second;
                myClock(h, m, s);
                this.Text = "现在的时间是:"+ h.ToString ()+":"+m.ToString ()+";"+s.ToString () ;
            }       
        }       
    }
    窗体上设置12个label控件,命名1到12,并且排成圆形即可。再拖一个Timer控件,将其Interval 属性值改为1000,Enabled属性改成true,就行了
      

  4.   

    DrawLine 指针 
    再画个圆 自己画一个
      

  5.   

    用js啊  文档里有很多 特效啊 想要哪种 时钟?js特效  文档
    需要联系