Exemplo n.º 1
0
        private void Form1_Shown(object sender, EventArgs e)
        {
            reloj rj = new reloj();

            int centroX = this.Width / 2,
                centroY = this.Height / 2,
                mDig    = (rj._tamaño * 12);

            Digito[] d = new Digito[4];

            for (int dig = 3; dig > 0; dig++)
            {
                d[dig] = new Digito(rj, centroX - mDig * dig - 1, 200);
            }



            d[0].numero(1);
            d[1].numero(2);
            d[3].numero(3);
            d[4].numero(4);

            timer1.Enabled = true;
            timer1.Start();
        }
Exemplo n.º 2
0
        public static void Main(string[] args)
        {
            int opcion;

            Principal programa = new Principal();

            programa.muestraMenu();
            opcion= int.Parse( Console.ReadLine() );
            switch(opcion){

            case 1:
            for(;;){
                    reloj unReloj = new reloj(); //crear un objeto de la clase reloj
                    unReloj.HoraActual();
                    }
                break;

            case 2:
                    Cronometro unCronometro = new Cronometro();
                    unCronometro.iniciarCronometro();
                break;

            default: Console.WriteLine("Opcion no valida\nIntente de nuevo");
                break;
            }
        }
Exemplo n.º 3
0
        public Digito(reloj _rj)
        {
            this.rj = _rj;

            this.Dx = rj._fm.Width / 2;
            this.Dy = rj._fm.Height / 2;
            this.cl = Color.FromArgb(0, 0, 0);
        }
Exemplo n.º 4
0
        public Digito(reloj _rj, int x, int y)
        {
            this.rj = _rj;

            this.Dx = x;
            this.Dy = y;
            this.cl = Color.FromArgb(0, 0, 0);
        }
Exemplo n.º 5
0
        public Digito(reloj _rj, int x, int y, Color c)
        {
            this.rj = _rj;

            this.Dx = x;
            this.Dy = y;
            this.cl = c;
        }
Exemplo n.º 6
0
 public void LeerEntrada()
 {
     int opcion = int.Parse(Console.ReadLine());
     if (opcion == 1)
     {
         reloj Reloj = new reloj();
         Reloj.iniciar();
     }
     else
     {
         cronometro Cronometro = new cronometro();
         Cronometro.Iniciar();
     }
 }