Another way to implement a digital clock

Source: Internet
Author: User

Not long ago in the Vckbase online to see a digital electronic clock program, down after the use of later feel very good, do pretty. Leisure pondering, found another way to realize the digital clock, although the effect is not in front of the comrade good, but in the attitude of learning I put my ideas published. Hope for everyone to learn from the significance.

The previous author used the method of drawing numbers on top of static controls and then displaying different colors on different areas based on different numbers. The difficulty with this is how to accurately calculate the coordinates and regions of different numbers, and once the size of the static control is not coordinated, the number shown is very distorted. My idea is to use static controls to make up different numbers, and then fill the numbers with different colors to display different numbers when the values are displayed.

The final effect figure is as follows:

Specifically implemented as follows:

1. Page Design

The static text controls are arranged in digital format, and an arranged number is shown in Figure A. In order for the control's ID to be contiguous for functional processing, the control ID that is set to display each digit is contiguous so that you can subtract an integer from the ID of the previous control to get the ID of the next control. The ID order of the controls shown in the figure is the same as the number displayed by the control. In order to make the interface more beautiful, give a good control with a background rectangle control, each time the color of the rectangle and the color of the control, so that you can give a dynamic sense of reality.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.