Search code examples
delphivclvcl-styles

VCL Styles - Only skin one control


I only want to skin / style one single control on my form using vcl styles and leave the rest to windows default.

In this example i want to skin the TButton component.

This is my form:

enter image description here

After applying a VCL style i get:

enter image description here

But what i want is:

enter image description here

The Bitmap-Style-Designer included with the IDE didn't seem to allow specifying which controls to skin so maybe there is a "trick" to do this?


Solution

  • The VCL Styles are global to the application. So you can try disabling the VCL Styles for all the controls except for the button how is shown here (this method have some limitations), or even better you can draw the button yourself using the VCL Styles look and feel like so.

    var
      LStyleServices : TCustomStyleServices;
    begin
      LStyleServices:=TStyleManager.Style['AnyLoadedVclStyle'];
      //draw the button with using LStyleServices 
    
      ....       
    end;