Back to Devexpress

TcxCustomLookAndFeelController.BeginUpdate Method

vcl-cxlookandfeels-dot-tcxcustomlookandfeelcontroller-b1e4e940.md

latest3.4 KB
Original Source

TcxCustomLookAndFeelController.BeginUpdate Method

Postpones all control redraw operations that reflect look & feel setting changes until an EndUpdate procedure call.

Declaration

delphi
procedure BeginUpdate;

Remarks

Every time you modify a global look & feel setting in the Skin Controller component, all application forms and DevExpress controls redraw their content to reflect the change. Enclose multiple look & feel setting changes between BeginUpdate and EndUpdate procedure calls to avoid UI flickering due to excessive redraw operations and improve performance.

BeginUpdate/EndUpdate and Batch Changes

A BeginUpdate procedure call disables notifications and postpones all changes until an EndUpdate call. A subsequent EndUpdate call does the following:

  • Re-enables change notifications and corresponding redraw operations
  • Applies all changes made after a BeginUpdate call
  • Sends corresponding notifications in a batch
  • Redraws all affected forms and controls in an application

Note

Ensure that every BeginUpdate procedure call is followed by an EndUpdate procedure call, even if an exception occurs. Otherwise, the application remains frozen and unresponsive.

Code Examples: Apply a Skin and its Palette

The following code example applies the WXICompact skin and its Sharpness palette to an application:

delphi
dxSkinController1.BeginUpdate;
  try
    dxSkinController1.UseSkins := True;
    dxSkinController1.NativeStyle := False;
    dxSkinController1.SkinName := 'WXICompact';
    dxSkinController1.SkinPaletteName := 'Sharpness';
  finally
    dxSkinController1.EndUpdate;
  end;
cpp
dxSkinController1->BeginUpdate();
  try
  {
    dxSkinController1->UseSkins = true;
    dxSkinController1->NativeStyle = false;
    dxSkinController1->SkinName = "WXICompact";
    dxSkinController1->SkinPaletteName = "Sharpness";
  }
  __finally
  {
    dxSkinController1->EndUpdate();
  }

Alternatively, you can call the SetSkin procedure:

delphi
dxSkinController1.BeginUpdate;
  try
    dxSkinController1.NativeStyle := False;
    dxSkinController1.SetSkin('WXICompact', 'Sharpness');
  finally
    dxSkinController1.EndUpdate;
  end;
cpp
dxSkinController1->BeginUpdate();
  try
  {
    dxSkinController1->NativeStyle = false;
    dxSkinController1->SetSkin("WXICompact", "Sharpness");
  }
  __finally
  {
    dxSkinController1->EndUpdate();
  }

See Also

TcxLookAndFeel.BeginUpdate Procedure

TcxCustomLookAndFeelController Class

TcxCustomLookAndFeelController Members

cxLookAndFeels Unit