LoadSkin Method
Description
Loads a skin from a .cjstyles or .msstyles file.
Syntax
Public Function LoadSkin( _
ByVal ResourcePath As String, _
ByVal IniFileName As String _
) As Boolean
Parameters
- ResourcePath: Path to a .cjstyles or .msstyles skin file. This is the file that contains one or more .ini files.
- IniFileName: Name of the .ini file of skin to apply. If no .ini file name is supplied, the first .ini file found will be used.
Return Type
Returns True if the skin was successfully applied, False if the skin could not be applied or the skin file was not found.
Remarks
To apply skins, the ApplyWindow method must be called. ApplyWindow only needs to be called one time in the Load event of the window a skin will be applied. This tells the SkinFramework which window to apply skins to. The skin will be applied to all child windows as well.
To load the default system appearance skin, call LoadSkin passing in a "" (blank string) for both ResourcePath and IniFileName.
There are some situations where a control will not be able to automatically be skinned as the parent control might not support seamless background texturing. In these cases, the EnableThemeDialogTexture method can be used to apply the skin texture to the child control.
The ApplyOptions property is used to specify which parts of the application will be skinned.
Tip: You can find many free custom skins on the Internet that can be used with your application.
Example
Loading a skin with the LoadSkin method (Visual Basic): This sample illustrates how to load and apply a skin to a window.
Private Sub Form_Load()
' Loads the NormalOffice2007.ini skin
SkinFramework.LoadSkin App.Path + "..\..\..\Styles\Office2007.cjstyles", "NormalBlue.ini"
' Loads currently set system skin
' SkinFramework.LoadSkin "", ""
' Applies the currently loaded skin to the specified window
SkinFramework.ApplyWindow Me.hWnd
End Sub
See Also
- SkinFramework Control
- ApplyWindow Method
- EnableThemeDialogTexture Method
- SkinFrameworkApplyOptions Enumeration
- ApplyOptions Property
Copyright (c) 1998-2024 Codejock Technologies. All rights reserved.