登录
首页 » 界面开发 » 基于c#的时钟

基于c#的时钟

于 2022-01-26 发布 文件大小:47.56 kB
0 61
下载积分: 2 下载次数: 1

代码说明:

资源描述本源程序是基于C#的时钟设计,能为初学者提供参考价值,为初学者提供基本的编写代码思路, namespace Clock { public partial class MainForm : Form { private PointF center; private float r; private Pen hourPen; private Pen minutePen; private Pen secondPen; private Thread timeThread; public MainForm() { InitializeComponent(); ShowInTaskbar = false;//不在任务栏中显示 SetStyle(ControlStyles.DoubleBuffer, true); SetStyle(ControlStyles.UserPaint,true); SetStyle(ControlStyles.AllPaintingInWmPaint,true); center = new PointF(ClientSize.Width/ 2.0f, ClientSize.Height/ 2.0f); r = Math.Min(ClientSize.Width / 2.0f, ClientSize.Height / 2.0f); hourPen = new Pen(Color.Black, 2.5f); minutePen = new Pen(Color.Black, 1.5f); secondPen = new Pen(Color.Black, 0.5f); timeThread=new Thread(new ThreadStart(DrawTime)); timeThread.Start(); } protected override void OnPaint(PaintEventArgs e) { Graphics g = e.Graphics; g.Clear(BackColor); //g.SmoothingMode =

下载说明:请别用迅雷下载,失败请重下,重下不扣分!

发表评论

0 个回复

  • 696518资源总数
  • 104225会员总数
  • 32今日下载