Windows Forms Chart Control
Create Clock user interface to Windows Forms application
Clock Control for WinForms Overview
The Clock control is a Windows Forms component that is used to design time user interface for developers. It helps developers easily display time in Windows Forms applications. It is because the WinForms Clock control uses a bitmap image as the background that developers cannot customize the size of the Clock control in Windows Forms applications.
Related Controls for UI Design in WinForms
Key Properties of Clock Control for WinForms
- Value , this is the property used to configure value of the control
- DisplaySystemTime , this property is used to determine if display the system time by using the Clock control
- Offset , this property is used to set time offset and display various time zones of the world
How to Use the Clock Control in Windows Forms
The below steps show the process of creating a windows forms application, adding the Clock control to the application, and displaying time on it
- Create a Windows Forms project in Microsoft Visual Studio.
- Add the Clock control to your Windows Form template project
- Drag and drop three Clocks to the Forms in your Windows Forms application.
- Place a label on the top of the Clocks, and set the text of the labels on the Clock as London, Tokyo and New York.
- In the code behind, set the property of DisplaySystemTime to first clock as displaying the time of London, and then set the Offset properties of the rest of the clocks to: +7, -6.
londonClock.DisplaySystemTime = true;
tokyoClock.Offset = new TimeSpan(7, 0, 0);
newYorkClock.Offset = new TimeSpan(-6,0,0);