Using the Application Object |
The BarTender.Application object represents the complete BarTender application. It is a top-level object in the ActiveX API, which means that all programs that are written with ActiveX Automation rely on the print functionality that is contained within the Application object.
The Application object provides basic BarTender functionality, and you can use it to control the visibility of the BarTender user interface, run a command line, save BarTender documents, and exit the bartend.exe process. It can also be used to set application-wide settings.
|
We recommend that you use the fully qualified names of BarTender objects, as shown in all examples in this help documentation. If you prefer to use the shorter form of the names, you can add a VB.NET Imports BarTender or a C# using BarTender command to your program. However, when you use C#, you must still fully qualify references to an Application class as either BarTender.Application or System.Windows.Forms.Application. |
The following example shows the minimum code that is necessary to create an instance of BarTender and exit the BarTender process.
In some cases, you want to use a BarTender application that is already running on your computer. In this scenario, you must retrieve the instance of the application that is running so that you can use it. The following example shows the minimum code that is necessary to retrieve an already running instance of BarTender and exit the BarTender process:
By default, the Application object runs a BarTender process in the background without being seen by a user. However, sometimes you want to view and interact with the BarTender user interface. The following example shows how to view the user interface by using the Application.Visible property and then exit the application.
You can use other properties, methods, and objects of the Application object to do the following:
Access information about your licensed copy of BarTender by using the Application.Edition and Application.Version properties.
Access other objects in the BarTender hierarchy.
Save all open documents by using the Application.Save method.
Manage the appearance of the BarTender application window by using the Window object.
Export a printer code template by using the PrinterCodeTemplate object.
For a complete list of properties, methods, and events that are available, refer to Application Object.
Related Topics