StyleCollection Class
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.