From 2e12fd244bf7d49702abb2f12cce0c3952fcf7d2 Mon Sep 17 00:00:00 2001 From: Alee14 Date: Thu, 17 May 2018 14:09:47 -0400 Subject: Clock is working --- Project Ports/Desktop.cs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'Project Ports/Desktop.cs') diff --git a/Project Ports/Desktop.cs b/Project Ports/Desktop.cs index b5ab3e5..a02a0e8 100644 --- a/Project Ports/Desktop.cs +++ b/Project Ports/Desktop.cs @@ -36,19 +36,19 @@ namespace Project_Ports InitializeComponent(); } - private void Desktop_Load(object sender, EventArgs e) + private void dclock_Tick(object sender, EventArgs e) { - MessageBox.Show("Welcome to the Project Ports Desktop!"); + + this.ltime.Text = DateTime.Now.ToString("hh:mm tt"); } - public static string GetTime() + private void Desktop_Load(object sender, EventArgs e) { - var time = DateTime.Now; - - return time.TimeOfDay.TotalHours > 12 ? $"{time.Hour - 12} PM" : $"{time.Hour} AM"; - + MessageBox.Show("Welcome to the Project Ports Desktop!"); + dclock.Start(); } + private void label1_Click(object sender, EventArgs e) { -- cgit v1.2.3