Getting Started with Windows Forms Clock
22 Jul 20264 minutes to read
This section provides a quick overview for working with the Clock control for WinForms.
Assembly deployment
Refer to the Control dependencies section to get the list of assemblies or details of NuGet package that needs to be added as a reference to use the control in any application.
Click NuGet Packages to learn how to install NuGet packages in a Windows Forms application.
Creating Application with Clock
In this walkthrough, users will create a WinForms application that contains Clock control.
Creating the Project
Create a new Windows Forms project in Visual Studio to display Clock with data objects.
Adding Clock control via designer
-
Create a new Windows Forms project in Visual Studio.
-
The Clock control can be added to an application by dragging it from the toolbox to the designer view. The following dependent assemblies will be added automatically:
- Syncfusion.Grid.Base
- Syncfusion.Grid.Windows
- Syncfusion.Shared.Base
- Syncfusion.Shared.Windows
- Syncfusion.Tools.Base
- Syncfusion.Tools.Windows

Adding Clock control via code
To add the control manually in C#, follow the given steps:
-
Create a C# or VB application via Visual Studio.
-
Add the following assembly references to the project:
- Syncfusion.Grid.Base
- Syncfusion.Grid.Windows
- Syncfusion.Shared.Base
- Syncfusion.Shared.Windows
- Syncfusion.Tools.Base
- Syncfusion.Tools.Windows
-
Include the required namespace.
using Syncfusion.Windows.Forms.Tools;Imports Syncfusion.Windows.Forms.Tools -
Create an instance of the Clock control, and add it to the form.
using Syncfusion.Windows.Forms.Tools; Clock clock1 = new Clock(); this.Controls.Add(clock1);Imports Syncfusion.Windows.Forms.Tools Dim clock1 As New Clock() Me.Controls.Add(clock1)

Clock type
You can change the analog clock to digital clock by setting the ClockType property of the Clock control.
using Syncfusion.Windows.Forms.Tools;
clock1.ClockType = Syncfusion.Windows.Forms.Tools.ClockTypes.Digital;Imports Syncfusion.Windows.Forms.Tools
clock1.ClockType = Syncfusion.Windows.Forms.Tools.ClockTypes.Digital
For Analog Clock,
using Syncfusion.Windows.Forms.Tools;
clock1.ClockType = Syncfusion.Windows.Forms.Tools.ClockTypes.Analog;Imports Syncfusion.Windows.Forms.Tools
clock1.ClockType = Syncfusion.Windows.Forms.Tools.ClockTypes.Analog
Change date and time
To enable custom time, the Clock control should be enabled by setting the ShowCustomTimeClock property to true, and the custom time should be in date-time format.
using Syncfusion.Windows.Forms.Tools;
clock1.ShowCustomTimeClock = true;
clock1.CustomTime = new System.DateTime(2019, 7, 3, 16, 50, 1, 0);Imports Syncfusion.Windows.Forms.Tools
clock1.ShowCustomTimeClock = True
clock1.CustomTime = New System.DateTime(2019, 7, 3, 16, 50, 1, 0)