separator separator

Changing skin

Alternatives to allow the user to change the skin:

1) The simplest way to allow the user to change the skin is to leave visible the 'Change skin' button in the title bar as it is by default. You can see some ways to customize this alternative in the topic To customize how the change skin dialog box is shown.
If this button doesn't appear in the title bar then go to the 'Custom' property in the properties screen, and in the property page 'Buttons' select 'Change skin' = True

2) To show the change skin dialog box by code.
For showing the change skin dialog box by code call the method ShowChangeSkinDialog. Also read the ChSD_UserAvailableOptions property.

3) Making your own dialog box to change skin.
This is the alternative that requires more code, but most versatile, since you could make that in the same dialog box the user can select some other features not included in the vbSkinner control and that they are particular of your project.
Note: set the  SaveToRegistry property to False of the vbSkinner control that you place in this form (form of the dialog box), and then if the user have pressed the Ok command button, call the SaveValuesToRegistry method of the same control.

An example of the exposed thing is the following one:

'In the declarations section of the form place this code:

Public mSkinnerControl As Skinner

Private Sub cmdOk_Click()
    Screen.MousePointer = vbHourglass
    If mSkinnerControl.Skin = skAuto_ReadFromRegistry Then
        Skinner1.SaveValuesToRegistry
    Else
        If Skinner1.Skin = skCreateFromPicture Then
            Set mSkinnerControl.SkinPicture =_
                Skinner1.SkinPicture
        Else
            mSkinnerControl.TitleBarSkin =_
                Skinner1.TitleBarSkin
            mSkinnerControl.TitleBarForeColor =_
                Skinner1.TitleBarForeColor
            mSkinnerControl.BodySkin = Skinner1.BodySkin
            mSkinnerControl.BodyForeColor =_
                Skinner1.BodyForeColor
        End If
    End If
    Hide
    Unload Me
    Screen.MousePointer = vbDefault
End Sub

When displaying the customized dialog box of changing skin do it this way:

Set YourForm.mSkinnerControl = Me.Skinner1
YourForm.Show 1

4) Some another variant that you could think, like for example to design some own skins and to place them in a ImageList control, then to make available some way to change them.
In order to do this set the SkinPicture property of the vbSkinner control to the image that you get from the ImageList.

5) To include in the setup package the skins that you want to provide to the user. These skins must be placed in the folder ChSD_SkinsFolder, by default it is the same one of the application. In that case may be that you prefer to set the ChSD_SaveSkinsFolder property to False,  so the user will use always the same folder for the skins.

separator

See also: How to use the vbSkinner control
To customize how the change skin dialog box is shown
To design skins
SkinPicture (property)

separator

ActiveX controls for Visual Basic 6 - homevbSkinner help main page Beginning   Go back Back