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.