Using the Application Object |
The BarTender.Application object represents the complete BarTender application. It is a top level object in the ActiveX API, meaning that all programs written with the ActiveX Automation rely on the print functionality contained within the Application object. The Application object provides basic BarTender functionality, and allows you to control the visibility of the BarTender user interface, execute a command line, save BarTender documents, and quit the bartend.exe process. It can be used to set application wide settings.
|
We recommend that you use the fully qualified names of BarTender objects, as we do in all examples in this help. 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, with C#, you will still need to fully qualify references to an Application class as either BarTender.Application or System.Windows.Forms.Application |
The following is the minimal code necessary to create an instance of BarTender and quit the BarTender process:
In some cases, you may find that you want to use a BarTender application that is already running on your computer. Here, you will need to retrieve (or get) the instance of the application that is running in order to use it. The following is the minimal code necessary to retrieve an already running instance of BarTender and quit the BarTender process:
By default, the Application object runs a BarTender process in the background without being seen by a user. However, there may be times you will want to view and interact with BarTender’s user interface. The following example shows how to view BarTender’s user interface using the Application.Visible property, then quit the application.
Other properties, methods, and objects of the Application object allow you to:
Access information about your licensed copy of BarTender, using the Application.Edition and Application.Version properties.
Access other objects in BarTender hierarchy.
Save all open documents, using the Application.Save method.
Manage the appearence of the BarTender application window, using the Window object.
Export a printer code template, using the PrinterCodeTemplate object.
For a complete list of properties, methods, and events available, see documentation on the Application object.
Related Topics