From Xojo Documentation
Supported PlatformsProject Types: Desktop Platforms: macOS, Windows, Linux
Contains properties, methods, and events for managing desktop applications.
The following class constants can be used to specify the value of the StageCode property.
|For web apps, refer to WebApplication. For console apps, refer to ConsoleApplication. For iOS apps, refer to iOSApplication.|
A subclass of Application (called App) is automatically added when you create a new Desktop project. This new subclass gives you access to the Application class methods and events.
The App subclass has its own menu handlers which can be used to handle menu items when no windows are open or for menu items that should call the same menu handler regardless of which window is frontmost. You can change the global menubar by assigning a different menubar to its MenuBar property.
See the Control class for information on changing the cursor and adding cursors to your project.
Adding Additional Application Subclasses
If you wish, you can add additional subclasses based on the Application class to the project, but it is not necessary. If you do so, the one that is added to the project automatically is the one referred to by the App function and it is the one that will show the project’s build settings.
If AutoIncrementVersionInformation is checked (a design-time property) then the NonReleaseVersion property is increased by one each time you do a build (but not when you run the project).
The compiler truncates version information when building Windows applications when the version information is too long to store into the executable file. The current byte limitations for these fields are as follows:
|Field||Maximum length (bytes)|
Since there is no exception handler within the method, the runtime exception is passed up to the Application class, triggering the UnhandledException event.
This code in the UnhandledException event of the App class "catches" the unhandled OutOfBoundsException. Of course, it catches all unhandled OutOfBoundsExceptions throughout the application, so it doesn't know where the error occurred. You could instead place an Exception statement within the PushButton's Action event so that you can provide more specific diagnostics.
If error IsA OutOfBoundsException Then
MsgBox("An OutOfBounds Exception error has occurred!")