Skip to content

Instantly share code, notes, and snippets.

@mrgarita
Created October 21, 2017 05:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mrgarita/a3341ae7c390c89484de8d71654b3ffa to your computer and use it in GitHub Desktop.
Save mrgarita/a3341ae7c390c89484de8d71654b3ffa to your computer and use it in GitHub Desktop.
C#:デジタル時計
using System;
using System.Windows.Forms;
namespace デジタル時計
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
this.Text = Application.ProductName;
timer1.Interval = 500;
timer1.Enabled = true;
}
private void timer1_Tick(object sender, EventArgs e)
{
DateTime d = DateTime.Now;
label1.Text = string.Format("{0:00}:{1:00}:{2:00}", d.Hour, d.Minute, d.Second);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment