Category / Section
How to set custom time in the DigitalClock and AnalogClock?
1 min read
In the Clock, you can set custom time depending upon the needs, by enabling the ShowCustomTimeClock property. Additionally, the custom time should be specified to be shown in the Analog and Digital clocks by using the CustomTime property of the Clock.
The following code example demonstrates the same.
C#
// Shows the custom time. this.clock1.ShowCustomTimeClock = true; // Sets the custom time for the clock. this.clock1.CustomTime = new DateTime(2015, 7, 21, 05, 00, 00);
VB
'Shows the custom time. Me.clock1.ShowCustomTimeClock = True 'Sets the custom time for the clock. Me.clock1.CustomTime = New DateTime(2015, 7, 21, 05, 00, 00)
Figure 1: Analog clock and Digital clock with custom time
Sample Links: