SkinCollection Object

The SkinCollection object is a collection providing access to all skins
defined on the server. See Changing button images using skins
help topic for information about skins.
Remarks
The SkinCollection object allows you to perform the following tasks:
- Enumerate skins defined on the system;
- Retrieve skins by their names or ordinal numbers;
- Create new skins;
- Delete skins.
The SkinCollection object is a standard OLE Automation collection object.
Object access
To access SkinCollection object you need to retrieve it using the Skins property
of Server object.
Here P2F refers to the Server object instance.
Then you can access its properties and methods using the reference to the
created object.
Properties
| Name |
Type |
Parameters |
Description |
|
item |
Skin object |
SkinName:String or Number |
Returns a Skin object with the
given name or at the given position. If the parameter is of string type, it is
interpreted as a skin name and the skin with the specified name is returned.
If the parameter is of number type, it is interpreted as an ordinal position
and the skin at this position is returned. The ordinal number must lie
between 1 and the value of Count property. |
|
Count |
Integer |
|
Returns the number of skins
defined in the system. |
Examples
The following VBScript example retrieves a skin named "MySkin":
Set MySkin=SkinColl("MySkin")
|
The following script enumerates all defined skins and displays each skin name:
For I=1 To SkinColl.Count
MsgBox SkinColl.item(I).Name
Next
|
In VBScript there is a more elegant way of enumerating the skins because SkinCollection
object is a standard OLE Automation collection:
For Each Skin in SkinColl
MsgBox Skin.Name
Next
|
Methods
Add
Adds a new empty skin.
Signature
Add (SkinName)
Return value
Skin object
Arguments
| Name |
Type |
Description |
| SkinName |
String |
The name you want to assign to the
new skin. Each skin must have a unique name. |
Remarks
This method creates a new skin, adds it to the collection and returns a
Skin object representing the new skin. Then you may
setup skin properties using this object reference.
Examples
The following example creates a new skin, sets a logo URL and saves the
skin:
Set MySkin=SkinColl.Add("MySkin")
MySkin.LogoURL="http://mysite.com"
MySkin.ApplyChanges
|
Delete
Method deletes a skin with the given name.
Signature
Delete (SkinName)
Arguments
| Name |
Type |
Description |
| SkinName |
String |
The name of the skin to delete. |
Examples
The following example deletes the skin named "MySkin":
SkinColl.Delete("MySkin")
|
RenameSkin
Method renames a skin.
Signature
RenameSkin (SkinObject, NewName)
Arguments
| Name |
Type |
Description |
| SkinObject |
Skin |
A reference to the
Skin object which name you want to change. |
| NewName |
String |
New skin name. |
Examples
The following example gives the skin named "MySkin" a new name "NewSkin":
Set MySkin=SkinColl("MySkin")
SkinColl.RenameSkin(MySkin,"NewSkin")
|
|