vcl-dxskinsdefaultpainters-dot-dxskinsuserskinloadfromfile-x28-eade2525-x29.md
Loads a skin from a specified SKINRES file.
function dxSkinsUserSkinLoadFromFile(const AFileName: string; const ASkinName: string = ''): Boolean;
| Name | Type | Description |
|---|---|---|
| AFileName | string |
The absolute or relative path to the source SKINRES file.
| | ASkinName | string |
Optional. Specifies the name of the required skin in the source SKNIRES file (AFileName).
If this parameter is omitted, the function loads the first skin in the source SKINRES file if it contains multiple skins.
|
| Type | Description |
|---|---|
| Boolean |
True if the skin load operation is successful; otherwise, False.
|
Call the dxSkinsUserSkinLoadFromFile function to load a custom skin from a SKINRES file created in the Skin Editor tool.
A custom skin can miss certain elements available in the current version of DevExpress skins. You can call the dxSkinsLoadedUserSkinHasMissingElements function to validate the loaded skin after a dxSkinsUserSkinLoadFromFile function call.
The code example below loads a custom skin from a SKINRES file and applies the loaded skin to an application. If an attempt to load a custom skin is unsuccessful, the code example applies the WXICompact skin and its Sharpness palette to the application.
uses
dxSkinsDefaultPainters; // Declares the dxSkinsUserSkinLoadFromFile function
// ...
begin
dxSkinController1.NativeStyle := False;
if(dxSkinsUserSkinLoadFromFile('MySkin.skinres')) then
dxSkinController1.SkinName := 'UserSkin'
else
begin
dxSkinController1.SkinName := 'WXICompact';
dxSkinController1.SkinPaletteName := 'Sharpness';
end;
end;
#include "dxSkinsDefaultPainters.hpp" // Declares the dxSkinsUserSkinLoadFromFile function
// ...
dxSkinController1->NativeStyle = false;
if(dxSkinsUserSkinLoadFromFile("MySkin.skinres"))
dxSkinsController1->SkinName = "UserSkin";
else
{
dxSkinController1->SkinName = "WXICompact";
dxSkinController1->SKinName = "Sharpness";
}
See Also
dxSkinsUserSkinLoadFromFileByIndex Global Function
dxSkinsUserSkinLoadFromStream Global Function