Reloj / progressBar / trackBar




using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;


namespace Reloj_I
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
            progressBar1.Minimum = 0;
            progressBar1.Maximum = 23;
            progressBar1.Style = ProgressBarStyle.Continuous;
            progressBar2.Minimum = 0;
            progressBar2.Maximum = 59;
            progressBar2.Style = ProgressBarStyle.Continuous;
            progressBar3.Minimum = 0;
            progressBar3.Maximum = 59;
            progressBar3.Style = ProgressBarStyle.Continuous;
            trackBar1.Minimum = 0;
            trackBar1.Maximum = 23;
            trackBar2.Minimum = 0;
            trackBar2.Maximum = 59;
            trackBar3.Minimum = 0;
            trackBar3.Maximum = 59;
            timer1.Interval = 10;
            timer1.Enabled = true;
        }




        private void timer1_Tick(object sender, EventArgs e)
        {
            progressBar1.Value = DateTime.Now.Hour;
            progressBar2.Value = DateTime.Now.Minute;
            progressBar3.Value = DateTime.Now.Second;
            trackBar1.Value = DateTime.Now.Hour;
            trackBar2.Value = DateTime.Now.Minute;
            trackBar3.Value = DateTime.Now.Second;
            label4.Text = DateTime.Now.ToLongTimeString();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            Application.Exit();
        }
    }
}


No hay comentarios:

Publicar un comentario

Nota: solo los miembros de este blog pueden publicar comentarios.