コード例 #1
0
        private void dateTimer_ValueChanged(object sender, EventArgs e)
        {
            // If the value changed, then update the label with the angle

            // Ignore the second hand
            if (dateTimer.Value.Second != prevTime.Second)
            {
                prevTime = dateTimer.Value;
                return;
            }
            else
            {
                // Update the previous time held
                prevTime = dateTimer.Value;

                // Update the label with the new angle
                clock.Hour   = dateTimer.Value.Hour;
                clock.Minute = dateTimer.Value.Minute;
                string angle = String.Format("{0}", clock.Calculate());
                lblAngle.Text = angle;
            }
        }