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 _2TryAlarmClock { public partial class Form1 : Form { public Form1() { InitializeComponent(); } DateTime alarmtime; private void timer1_Tick(object sender, EventArgs e) { label3.Text = DateTime.Now.ToLongTimeString(); if(label3.Text.Equals(alarmtime.ToString("HH:mm:ss"))) { MessageBox.Show("Correct"); } else { MessageBox.Show("Un-Correct"); } } private void Form1_Load(object sender, EventArgs e) { } private void alarmon() { DateTime dt = DateTime.Now; int hour = Convert.ToInt32(comboBox1.Text); int min = Convert.ToInt32(comboBox2.Text); int sec = Convert.ToInt32(comboBox3.Text); alarmtime = new DateTime(dt.Year, dt.Month, dt.Day,hour, min, sec); timer1.Enabled = true; } private void cloudStartMenuButton1_Click(object sender, EventArgs e) { alarmon(); } } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)