Getting Started

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.

Adding Clock control via designer

1) Create a new Windows Forms project in Visual Studio.

2) The Clock control can be added to an application by dragging it from the toolbox to a 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

Windows Forms clock control added by designer

Adding Clock control via code

To add the control manually in C#, follow the given steps:

1) Create a C# or VB application via Visual Studio.

2) 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

3) Include the required namespace.

using Syncfusion.Windows.Forms.Tools;
Imports Syncfusion.Windows.Forms.Tools

4) Create an instance of the Clock control instance, and add it to the form.

Clock clock1 = new Clock();
this.Controls.Add(clock1);
Dim clock1 As New Clock()
Me.Controls.Add(clock1)

wf clock control

Clock type

You can change the analog clock to digital clock by setting the ClockType property of the Clock control.

clock1.ClockType = Syncfusion.Windows.Forms.Tools.ClockTypes.Digital;
clock1.ClockType = Syncfusion.Windows.Forms.Tools.ClockTypes.Digital

Windows Forms Clock shows digital clock

For Analog Clock,

clock1.ClockType = Syncfusion.Windows.Forms.Tools.ClockTypes.Analog;
clock1.ClockType = Syncfusion.Windows.Forms.Tools.ClockTypes.Analog

Windows Forms clock shows analog clock

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.

clock1.ShowCustomTimeClock = true;
clock1.CustomTime = new System.DateTime(2019, 7, 3, 16, 50, 1, 0);
clock1.ShowCustomTimeClock = True
clock1.CustomTime = New System.DateTime(2019, 7, 3, 16, 50, 1, 0)

Windows Forms Clock shows customized time