Exemple #1
0
        private void btnStartStop_Click(object sender, EventArgs e)
        {
            //Enable the stop button
            btnStopClock.Enabled = true;
            btnStartClock.Enabled = false;

            //Determine which rdo is checked
            if (rdoDigital.Checked == true)
            {
                //Hide the other clock
                analogClock1.Visible = false;

                //Instantiate a digital clock.
                clock = new DigitalClock(lblDigiTime, timer1);
                clock.Show();
                clock.On();
            }
            else
            {
                //Hide the other clock
                lblDigiTime.Visible = false;

                //Instantiate an Analog clock.
                clock = new AnalogClock(analogClock1, timer1);
                clock.Show();
                clock.On();
            }
        }