NanUI

System Style Forms

Overview

The system form style is the default style of the Formium form. It has two forms. One is consistent with the style of the Windows Form form, including title bar, maximize, minimize, and close buttons. The other is to remove the system default title bar and command button area, but retain the system border. Both styles are controlled through the property TitleBar.

Use the extension method UseSystemForm of WindowStyleBuilder to enable the system form style. The return value of this method is the SystemFormStyle type, which inherits from the FormStyle class, so you can use the properties of the FormStyle class to set the window The base style of the form, and use the properties of the SystemFormStyle class to set the style properties specific to the system form style.

protected override FormStyle ConfigureWindowStyle(WindowStyleBuilder builder)
{
     var style = builder.UseSystemForm();
     return style
}

Another property of the system form style, BackdropType, is used to set the rendering type of the form background. By default, CEF is embedded in the Windows Form area of Formium as an independent subform, but the Windows system provides a variety of form background materials. If the browser is placed using a subform, the browser will override these material effects. , if you want to enable these material features, you need to use CEF’s off-screen rendering function to render the web page into a bitmap with alpha channel in the memory, and then WinFormium will render the image onto the form background, thereby realizing the form background and Hybrid rendering of web content. The BackdropType property is used to set the rendering type of the form.

The following articles will detail the unique properties of these two system form styles.

TitleBar property

Preserve system form styles for title bar and command control area

protected override FormStyle ConfigureWindowStyle(WindowStyleBuilder builder)
{
     var style = builder.UseSystemForm();
     style.TitleBar = true;
     return style
}

Remove system form styles from title bar and command control area

protected override FormStyle ConfigureWindowStyle(WindowStyleBuilder builder)
{
     var style = builder.UseSystemForm();
     style.TitleBar = false;
     return style
}

The following picture examples show the difference between the two different attributes of the system form style, opening the title bar and closing the title bar.

System form style

As for how to control the size and position of an untitled bar form, please refer to Forms without Titlebar.

BackdropType attribute [^*]

The BackdropType property is used to set the rendering type of the form. Different properties are supported by different operating systems. Unless otherwise specified, the minimum support is Windows 7 service pack 1 system. Currently the BackdropType property supports the following types:

See also