vcl-dxskinsform-dot-tdxskincontroller.md
Allows you to prevent the skin controller from applying the active skin to a supported control from the standard VCL Library.
property OnSkinControl: TdxSkinControlEvent read; write;
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.
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.
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.
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.
The TdxSkinController component applies the active skin and palette to all forms and all supported controls in the application.
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;
void __fastcall TMyForm::dxSkinController1SkinControl(TObject *Sender,
TWinControl *AControl, bool *&AProperties)
{
TdxSkinController *ASkinController;
// ...
ASkinController = dynamic_cast<TdxSkinController*>(Sender);
if((AControl->ClassType() == __classid(TButton)) && (ASkinController->SkinName == "WXI"))
UseSkin = false;
}
Footnotes
UseSkin parameter value matches the UseSkins property value.See Also
TdxSkinController.OnSkinForm Event
TdxSkinController.Refresh Procedure