SplashScreenManager.ShowOverlayForm(Control, OverlayWindowOptions) Method
Shows an Overlay Form with the specified options over the specified control.
Namespace: DevExpress.XtraSplashScreen
Assembly: DevExpress.XtraEditors.v19.2.dll
Declaration
public static IOverlaySplashScreenHandle ShowOverlayForm(
Control owner,
OverlayWindowOptions options
)
Parameters
Name | Type | Description |
---|---|---|
owner | Control | A Control that should be overlapped by an Overlay Form. |
options | DevExpress.XtraSplashScreen.OverlayWindowOptions | An OverlayWindowOptions object that specifies the Overlay Form options, such as the loading image, fade animation and colors. |
Returns
Type | Description |
---|---|
DevExpress.XtraSplashScreen.IOverlaySplashScreenHandle | A handle for the shown Overlay Form. Use this handle to close the Overlay Form. |
Remarks
Call the ShowOverlayForm to show an Overlay Form with the specified options over the owner control. The OverlayWindowOptions include the following:
- BackColor—Overlay Form’s background color;
- CustomPainter—an IOverlayWindowPainter object that performs the Overlay Form’s custom draw;
- FadeIn—enables/disables the fade in animation;
- FadeOut—enables/disables the fade out animation;
- ForeColor—Overlay Form’s foreground color;
- Image—image shown rotating in the Overlay Form’s center;
- Opacity—Overlay Form’s transparency level. 0 corresponds to total transparency, 1 - to the normal state.
Warning
You can only show an Overlay Form over a control/form that has a handle (see IsHandleCreated). Otherwise, an exception is thrown.
The ShowOverlayForm method returns an IOverlaySplashScreenHandle object. Pass this handle to the SplashScreenManager.CloseOverlayForm method to close the opened Overlay Form.
using DevExpress.XtraSplashScreen;
//...
public partial class ModuleOverlayForm : TutorialControl {
readonly OverlayWindowOptions options;
public ModuleOverlayForm() {
this.options = new OverlayWindowOptions(opacity: 100d/255);
InitializeComponent();
}
//...
void OnShowClick(object sender, EventArgs e) {
IOverlaySplashScreenHandle handle = SplashScreenManager.ShowOverlayForm(this.xtraTabPage1, options);
Timer timer = new Timer() { Interval = 4000 };
timer.Tick += (ss, ee) => {
SplashScreenManager.CloseOverlayForm(handle);
//You can also use the handle's Close method to close the form.
//handle.Close();
timer.Dispose();
};
timer.Start();
}
}
Note
Run the XtraEditors demo and click Open Solution for the complete example.