Back to Devexpress

XtraForm.DefaultFormShowMode Property

windowsforms-devexpress-dot-xtraeditors-dot-xtraform-035326bc.md

latest2.8 KB
Original Source

XtraForm.DefaultFormShowMode Property

Gets or sets how to display application forms.

Namespace : DevExpress.XtraEditors

Assembly : DevExpress.Utils.v25.2.dll

NuGet Packages : DevExpress.Utils, DevExpress.Wpf.Core

Declaration

csharp
[Browsable(false)]
[EditorBrowsable(EditorBrowsableState.Advanced)]
public static FormShowMode DefaultFormShowMode { get; set; }
vb
<Browsable(False)>
<EditorBrowsable(EditorBrowsableState.Advanced)>
Public Shared Property DefaultFormShowMode As FormShowMode

Property Value

TypeDescription
FormShowMode

Specifies how to display application forms.

|

Available values:

NameDescription
Default

Displays application forms immediately.

| | AfterInitialization |

Displays application forms only after their initialization.

|

Remarks

The DefaultFormShowMode property allows you to visually hide the form initialization process (in some cases, drawing controls may cause flickering). Set this property to AfterInitialization to initially display application forms with 0 opacity and return the opacity to 1 only after the form is completely initialized.

csharp
internal static class Program {
    [STAThread]
    static void Main() {
        // ...
        XtraForm.DefaultFormShowMode = FormShowMode.AfterInitialization;
    }
}
vb
Friend Module Program
    <STAThread>
    Private Sub Main()
        ' ...
        XtraForm.DefaultFormShowMode = FormShowMode.AfterInitialization
    End Sub
End Module

Alternatively, you can override the ShowMode property for a specific form:

csharp
public partial class Form1 : DevExpress.XtraEditors.XtraForm {
    protected override FormShowMode ShowMode => FormShowMode.AfterInitialization;
    // ...
}
vb
Public Partial Class Form1
    Inherits DevExpress.XtraEditors.XtraForm

    Protected Overrides ReadOnly Property ShowMode As FormShowMode
        Get
            Return FormShowMode.AfterInitialization
        End Get
    End Property
    ' ...
End Class

See Also

XtraForm Class

XtraForm Members

DevExpress.XtraEditors Namespace