Back to Devexpress

TdxVisualRefinements.ApplyLightStyle(Boolean) Method

vcl-cxlookandfeels-dot-tdxvisualrefinements-dot-applylightstyle-x28-system-dot-boolean-x29.md

latest4.2 KB
Original Source

TdxVisualRefinements.ApplyLightStyle(Boolean) Method

Applies Light Style to all DevExpress controls that support it.

Declaration

delphi
class procedure ApplyLightStyle(AUsePaddingForStandaloneEditors: Boolean = False); static;

Parameters

NameTypeDescription
AUsePaddingForStandaloneEditorsBoolean

Optional. This parameter specifies the UsePaddingsForStandaloneEditors class property value:

TrueThe procedure applies extra cell paddings to standalone DevExpress editors in addition to the same paddings applied to in-place editors in container controls.FalseThe procedure applies extra paddings only to in-place editors. |

Remarks

The Light Style rendering mode allows you to display all supported[1] controls without double or thick borders, extra outlines, and other visual noise. Light Style enables extra cell and header paddings, as well as lightweight borders in a control.

Code Example: Enable Light Style and Apply Extra Padding to Standalone Editors

The following image demonstrates a Data Grid control when Light Style is disabled:

The code example in this section enables Light Style and applies extra paddings to standalone editors.

Open the Project Source to Edit the Main Function

To open the main application unit of your project, you can use one of the following options:

  • Select ProjectView Source in the main menu of your RAD Studio IDE.

  • Select the target project in the Projects Window and press Ctrl + V (alternatively, you can display the context menu and select the View Source option).

  • Delphi

  • C++

delphi
uses
  Forms,
  cxLookAndFeels, // Adds the cxLookAndFeels unit to use the TdxVisualRefinements class
// ...

begin
  TdxVisualRefinements.ApplyLightStyle(True);
  Application.Initialize;
  Application.MainFormOnTaskbar := True;
  Application.CreateForm(TMyForm, MyForm);
  Application.Run;
end.
cpp
#include <vcl.h>
#include "cxLookAndFeels.hpp" // Adds the cxLookAndFeels unit to use the TdxVisualRefinements class
#pragma hdrstop
#include <tchar.h>
//---------------------------------------------------------------------------
USEFORM("Unit1.cpp", Form1);
//---------------------------------------------------------------------------
int WINAPI _tWinMain(HINSTANCE, HINSTANCE, LPTSTR, int)
{
    try
    {
        TdxVisualRefinements::ApplyLightStyle(true);
        Application->Initialize();
        Application->MainFormOnTaskBar = true;
        Application->CreateForm(__classid(TMyForm), &MyForm);
        Application->Run();
    }
    // ...

When Light Style is in effect, content in cells and headers becomes easier to read.

Tip

You can call the Reset procedure to disable all Light Style effects.

Footnotes

  1. Only the Data Grid supports Light Style in the current version.

See Also

TdxVisualRefinements.Reset Procedure

TdxVisualRefinements Class

TdxVisualRefinements Members

cxLookAndFeels Unit