Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.
This article provides all necessary information and instructions to perform barcode generation using GUI-based C# tools, such as WinForms and WPF.
AsposeBarCode for .NET enables GUI-based development using standard C# visual component frameworks: Windows Forms and Windows Presentation Foundation.
Windows Forms (WinForms) is a UI development platform that benefits from wide functionality, including graphics, controls, user input, data biding, and other features. It enables a drag-and-drop visual designer in Visual Studio to facilitate the implementation of Windows applications. WinForms provides various controls that can be added to forms, such as text boxes, buttons, drop-down boxes, radio buttons, and even web pages. To work with custom UI elements, developers can use the System.Drawing namespace that includes specified classes to render lines, circles, and other shapes directly on a form.
Windows Presentation Foundation (WPF) is a UI framework that allows creating desktop client applications. As a development tool, it is resolution-independent and employs a vector-based rendering engine to benefit from modern graphics hardware. It supports various application development features, including an application model, security, resources, graphics, controls, layout, documents, data binding, and others. WPF relies on the Extensible Application Markup Language (XAML) to enable a declarative model for application programming. Core WPF building blocks include the following: an application model to deploy application contents; the WPF layout system to simplify the arrangement of controls in a UI; data binding to facilitate the integration between UI and data; the comprehensive range of graphics, animation, and media support to enhance the visual appearance of an application.
To work with Aspose.BarCode for .NET using GUI-based tools, it is necessary to activate the product license in the application code. General information about how to buy a license or get a trial period is available in Licensing. In this case, the recommended way to install the license is to do that through lazy initialization using the Singleton pattern that serves to call the license setting code via the form initialization constructor, as shown in the code sample below.
internal class LicenseSingleton
{
private static LicenseSingleton _instance = new LicenseSingleton();
private LicenseSingleton()
{
// init the license
(new Aspose.BarCode.License()).SetLicense(@"{path}Aspose.Total.Product.Family.lic");
}
public static void SetLicense()
{
LicenseSingleton local = _instance;
}
}
//lazy initialization before using the library
LicenseSingleton.SetLicense();
The following code snippets illustrate how to call license installation code in WinForms and WPF.
Calling License Setting Code in WinForms
public Form1()
{
//set license
LicenseSingleton.SetLicense();
InitializeComponent();
}
Calling License Setting Code in WPF
public MainWindow()
{
//set license
LicenseSingleton.SetLicense();
InitializeComponent();
}
Aspose.BarCode for .NET includes a control class called BarCodeGeneratorControl that is inherited from System.Windows.Forms.Control class. BarcodeGeneratorControl class is the key component that enables barcode generation in WinForms. To start a new project in this way, follow the steps outlined below:
Aspose.BarCode for .NET is compatible with the DLL for the Microsoft WPF framework to enable building WPF-based applications. Barcode generation and recognition functionality can be deployed by referencing Aspose.BarCode.WPF.dll in WPF applications. To implement barcode generation in WPF, follow the steps described below.
Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.