Created
October 21, 2017 05:26
-
-
Save mrgarita/a3341ae7c390c89484de8d71654b3ffa to your computer and use it in GitHub Desktop.
C#:デジタル時計
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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