Skip to main content

TdxSkinController.OnSkinControl Event

Allows you to prevent the skin controller from applying the active skin to a supported control from the standard VCL Library.

Declaration

property OnSkinControl: TdxSkinControlEvent read; write;

Remarks

The TdxSkinController component can apply skins to standard forms and a number of standard VCL controls in addition to DevExpress forms and controls.

You can handle the OnSkinControl event to prevent the sin controller from applying the active skin and palette to any supported control (or its descendant) from the standard VCL library.

Tip

This technique can be useful if you do not need to apply DevExpress skins to supported standard VCL controls or third-party components based on these controls.

Supported Standard VCL Controls

Event Occurrence

The OnSkinControl event occurs once per supported standard VCL control when the TdxSkinController component is about to apply the active skin to the control. A Refresh procedure call raises the OnSkinControl event for supported standard controls.

Event Parameters

You can use the AControl parameter to access and identify the currently processed standard VCL control. To prevent the skin controller from applying the active skin to the currently processed control, you can assign False to the UseSkin[1] parameter.

Refer to the TdxSkinControlEvent procedural type description for detailed information on parameters accessible within an OnSkinControl event handler.

Redraw Skinned Controls

If you dynamically change skin-related settings within an OnSkinControl event handler in response to certain condition changes in your application, call the Refresh procedure to redraw all skinned forms and controls.

Code Example

The TdxSkinController component applies the active skin and palette to all forms and all supported controls in the application.

VCL Skin Library: A Skinned Form Example

The following code example prevents the WXI skin from being applied to all TButton controls:

procedure TMyForm.dxSkinController1SkinControl(Sender: TObject;
  AControl: TWinControl; var UseSkin: Boolean);
var
  ASkinController: TdxSkinController;
begin
  ASkinController := Sender as TdxSkinController;
  if((AControl.ClassType = TButton) and (ASkinController.SkinName = 'WXI')) then
    UseSkin := False;
end;

VCL Skin Library: The Skin Controller Does not Apply the WXI Skin to Standard Buttons

Footnotes
  1. The initial UseSkin parameter value matches the UseSkins property value.

See Also