dxSkinsUserSkinLoadFromFile(string,string) Method
Loads a skin from a specified SKINRES file.
#Declaration
#Parameters
Name | Type | Description |
---|---|---|
AFile |
string | The absolute or relative path to the source SKINRES file. |
ASkin |
string | Optional. Specifies the name of the required skin in the source SKNIRES file ( If this parameter is omitted, the function loads the first skin in the source SKINRES file if it contains multiple skins. |
#Returns
Type | Description |
---|---|
Boolean |
|
#Remarks
Call the dxSkinsUserSkinLoadFromFile
function to load a custom skin from a SKINRES file created in the Skin Editor tool.
#Custom Skin Validation
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.
#Code Example: Apply Custom Skins
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'))
dxSkinController1.SkinName := 'UserSkin'
else
begin
dxSkinController1.SkinName := 'WXICompact';
dxSkinController1.SkinPaletteName = 'Sharpness';
end;
end;