Getting Started with WinForms Calculator

18 Nov 20182 minutes to read

Assembly deployment

Refer to the control dependencies section to get the list of assemblies or NuGet packages that need to be added as a reference to use the control in any application.

You can find more details about installing the NuGet package in a Windows Forms application at the following link:

How to install NuGet packages

Create a simple application with WinForms Calculator

You can create a Windows Forms application with the WinForms Calculator control using the following steps:

Create a project

Create a new Windows Forms project in Visual Studio to display the WinForms Calculator control.

Add control through designer

The WinForms Calculator control can be added to an application by dragging it from the toolbox onto the designer surface. The following required assembly references will be added automatically to the project:

  • Syncfusion.Grid.Base
  • Syncfusion.Grid.Windows
  • Syncfusion.Shared.Base
  • Syncfusion.Shared.Windows
  • Syncfusion.Tools.Base
  • Syncfusion.Tools.Windows

WinForms Calculator control added to the form via the designer

Add control manually in code

To add the control manually, follow the steps below:

  1. Add the following required assembly references to the project:

    • Syncfusion.Grid.Base
    • Syncfusion.Grid.Windows
    • Syncfusion.Shared.Base
    • Syncfusion.Shared.Windows
    • Syncfusion.Tools.Base
    • Syncfusion.Tools.Windows
  2. Add the WinForms Calculator control namespace:

    using Syncfusion.Windows.Forms.Tools;
    Imports Syncfusion.Windows.Forms.Tools
  3. Create a WinForms Calculator control instance and add it to the form:

    CalculatorControl calculatorControl = new CalculatorControl();
    calculatorControl.Size = new Size(300, 250);
    this.Controls.Add(calculatorControl);
    Dim calculatorControl As CalculatorControl = New CalculatorControl()
    calculatorControl.Size = New Size(300, 250)
    Me.Controls.Add(calculatorControl)

WinForms Calculator control shown at runtime