15 Mayıs 2015 Cuma

C# Hatırlatıcı Programı



 Projemize iki tane timer ekliyoruz. Hatırlatıcı saatini girerkende resimde olduğu gibi 12:10:25 formatında giriyoruz.
Kodlar;



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 WindowsFormsApplication10
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
        string sonuc;
       
        private void timer1_Tick(object sender, EventArgs e)
        {
          
           if (textBox2.Text == label6.Text && dateTimePicker1.Text == dateTimePicker2.Text)
           {
               timer1.Stop();
               MessageBox.Show("Alarm  "+textBox3.Text.ToString());
             
           }
        }

        private void button1_Click(object sender, EventArgs e)
        {
            timer1.Start();
            DateTime zaman;
            zaman = DateTime.Now;
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            timer2.Start();
        }

        private void timer2_Tick(object sender, EventArgs e)
        {
           
            sonuc = string.Format("{0:HH:mm:ss}", DateTime.Now);
            label6.Text = sonuc.ToString();
        }
    }
}