Skip to main content

Control appearance

xtd is designed to manage controls and dialogs in pure native mode or with CSS styles.

By default all controls are defined with CSS mode (the property xtd::forms::control::control_appearance is set to xtd::forms::control_appearance::standard). xtd defines a CSS theme for each OS so that the emulation of the controls is identical to native controls.

For any control or dialog box, you can decide to use the native version in the following way:

  • Controls
 my_control.control_appearance(xtd::forms::control_appearance::system);
  • Buttons, group boxes and labels

    You can use control_appearance property like other controls, but flat_style property adds two additional options : flat and popup.

 my_button.flat_style(xtd::forms::flat_style::system);
  • Dialogs

    A dialog is not a control, so to avoid confusion, this property is called dialog_appearance.

 my_dialog.dialog_appearance(xtd::forms::dialog_appearance::system);

Remarks

  • You can create your own CSS styles for the whole application or for one or more specific controls according to your wishes.
  • Unlike standard controls, system controls have some limitations such as:
    • text alignment
    • background color
    • foreground colors
    • display of associated images
    • ...
  • Not all standard controls are implemented yet, in this case the native control is used even if the property xtd::forms::control::control_appearance is set to xtd::forms::control_appearance::standard.

See also