The PLUSManagedGui component includes support for displaying a customizable splash screen image (PNG images using alpha-transparency are supported). Splash screens are fairly ubiquitous, and their purpose is to inform the user that the application is initializing. Using a splash screen is especially useful when applications perform initialization that takes some time before showing the user interface.
Since you already implemented some additional code in your constructor to initialize objects as required to use PLUSManagedGui, your constructor will need to be updated to first hide the form to prevent it from being displayed prematurely, and it will also need to show the splash screen after the objects are initialized. An example of this modified constructor code is below.
To initialize the application's licensing objects, the application will need to:
This code would resemble the following:
Please keep in mind that the example logic here is simplified, and lacks support for advanced licensing features such as support for downloadable and volume license files.
Any logic that should be run when the initialization logic has completed should be implemented in its own method. In many (if not most) cases, this may only include showing the application's primary form or dialog. Here is an example of what this code can look like.
Next, open the form in the designer, click on the form (but not any of the controls on the form), click the lightning bolt icon in the properties pane, and double-click on the Shown event to create a handler. Then, add the code similar to the following in the event handler.
Once your initialization logic is implemented, you will need to proceed to wire method to handle an event. The easiest way to do this is to click on the LicensingGui component in the designer, click the lightning bolt icon in the properties pane, and select the newly created InitializeApplicationSettings method from the drop-down list for the SplashDoWork event. Also select the SplashWorkComplete method for the SplashWorkCompleteEvent.
The PLUSManagedGui component's LicensingGui object has several properties you can configure for customizing the look and feel of the splash screen. These properties are outlined in the table below, and are all configurable by selecting the LicensingGui component on your form's designer.
Property Name | Description |
---|---|
SplashBackgroundColor | The background color of the splash screen. This is the color displayed when no splash screen image is present. |
SplashImage | If specified, this is the image that is displayed on the splash screen. The splash screen will automatically size itself to match the size of the image. PNG images using alpha-transparency are supported. |
SplashMinimumDuration | The minimum duration of time (in milliseconds) in which the splash screen will be displayed. If your initialization logic completes sooner, the splash screen will continue to be displayed until this amount of time passes. |
SplashTopMost | When set to true, the splash screen will be displayed on top of all other windows/dialogs.. |