您的当前位置:首页正文

闹钟

2024-07-29 来源:客趣旅游网
C#程序设计:数字时钟设计

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 Excise_1_2 {

public partial class Form1 : Form {

public Form1() {

InitializeComponent(); }

private void timer1_Tick(object sender, EventArgs e) {

label1.Text = DateTime.Now.Hour.ToString() + \":\" + DateTime.Now.Minute.ToString() + \":\" + DateTime.Now.Second.ToString(); }

private void label1_Click(object sender, EventArgs e) {

timer1.Enabled = true; } } }

因篇幅问题不能全部显示,请点此查看更多更全内容