Getting Started with Windows Forms CurrencyEdit
30 May 20233 minutes to read
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 the CurrencyEdit control via designer
-
Create a new Windows Forms project in Visual Studio.
-
The CurrencyEdit 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.Tools.Base
- Syncfusion.Tools.Windows
- Syncfusion.Grid.Base
- Syncfusion.Grid.Windows
- Syncfusion.Shared.Base
- Syncfusion.Shared.Windows
Adding CurrencyEdit control via code
To add the control manually in C#, follow the given steps:
-
Create a C# or VB application using Visual Studio.
-
Add the following assembly references to the project:
- Syncfusion.Tools.Base
- Syncfusion.Tools.Windows
- Syncfusion.Grid.Base
- Syncfusion.Grid.Windows
- Syncfusion.Shared.Base
- Syncfusion.Shared.Windows
-
Include the required namespace.
using Syncfusion.Windows.Forms.Tools;
Imports Syncfusion.Windows.Forms.Tools
-
Create an instance of the CurrencyEdit control, and add it to form.
CurrencyEdit currencyEdit1 = new CurrencyEdit(); this.Controls.Add(currencyEdit1);
Dim currencyEdit1 As New CurrencyEdit() Me.Controls.Add(currencyEdit1)
-
Set the currency value using the Text property, and change the culture using the
Culture
property of currency symbol.// Set currency value. currencyEdit1.TextBox.Text = "$2.00"; // To change the culture. currencyEdit1.TextBox.Culture = new System.Globalization.CultureInfo("ksh-DE");
' Set currency value. currencyEdit1.TextBox.Text = "$2.00" ' To change the culture. currencyEdit1.TextBox.Culture = New System.Globalization.CultureInfo("ksh-DE")
Show or hide the drop-down calculator
You can show or hide the calculator button in the CurrencyEdit control by setting the ShowCalculator property.
// Hide the calculator button.
currencyEdit1.ShowCalculator = false;
' Hide the calculator button.
currencyEdit1.ShowCalculator = False