Export (0) Print
Expand All

StyleCollection Class

Represents a collection of Style objects.

Namespace: System.Web.UI.WebControls
Assembly: System.Web (in system.web.dll)

public class StyleCollection : StateManagedCollection
public class StyleCollection extends StateManagedCollection
public class StyleCollection extends StateManagedCollection
Not applicable.

Use the StyleCollection class to store and manage Style objects for a control. Control developers can use this class to contain a set of styles that apply to different portions of the control.

The collection dynamically increases in size as objects are added. Indexes in this collection are zero-based. Use the Count property to determine how many objects are in the collection.

Additionally, use the StyleCollection methods and properties to provide the following functionality:

  • The Add method to add a single style to the collection.

  • The Insert method to add a style at a particular index within the collection.

  • The Remove method to remove a style from the collection.

  • The RemoveAt method to remove the style located at a particular index.

  • The Contains method to determine whether a particular style is already in the collection.

  • The IndexOf method to retrieve the index of a style within the collection.

  • The Clear method to remove all the styles from the collection.

System.Object
   System.Web.UI.StateManagedCollection
    System.Web.UI.WebControls.StyleCollection

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Windows 98, Windows Server 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0

Community Additions

ADD
Show:
© 2014 Microsoft