StyleCollection Class
Represents a collection of Style objects.
Assembly: System.Web (in System.Web.dll)
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.
- AspNetHostingPermission
for operating in a hosted environment. Demand value: LinkDemand. Permission value: Minimal.
- AspNetHostingPermission
for operating in a hosted environment. Demand value: InheritanceDemand. Permission value: Minimal.
Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.