Spread Windows Forms 6.0 Product Documentation
Contains Method
See Also  Example Support Options
FarPoint.Win.Spread Assembly > FarPoint.Win.Spread Namespace > NamedStyleCollection Class : Contains Method


style
Style (NamedStyle object) for which to check in the collection

Glossary Item Box

Determines whether the collection contains the specified style (NamedStyle object).

Syntax

Visual Basic (Declaration) 
Public Overridable Function Contains( _
   ByVal style As NamedStyle _
) As Boolean
Visual Basic (Usage)Copy Code
Dim instance As NamedStyleCollection
Dim style As NamedStyle
Dim value As Boolean
 
value = instance.Contains(style)
C# 
public virtual bool Contains( 
   NamedStyle style
)

Parameters

style
Style (NamedStyle object) for which to check in the collection

Remarks

Boolean: true if the collection contains the named style; false otherwise

Example

This example determines whether the collection contains the specified named style.
C#Copy Code
FarPoint.Win.Spread.NamedStyleCollection nsc = new FarPoint.Win.Spread.NamedStyleCollection();
FarPoint.Win.Spread.NamedStyle ns1 = new FarPoint.Win.Spread.NamedStyle("StyleHeaders", "HeaderDefault");
FarPoint.Win.Spread.NamedStyle ns2 = new FarPoint.Win.Spread.NamedStyle("StyleData", "DataAreaDefault");
bool b;
ns1.BackColor = Color.LightBlue;
ns2.BackColor = Color.Gray;
nsc.AddRange(new Object[] {ns1, ns2});
fpSpread1.NamedStyles = nsc;
fpSpread1.ActiveSheet.ColumnHeader.DefaultStyle = nsc[0];
fpSpread1.ActiveSheet.DefaultStyle = nsc[1];
b = nsc.Contains(ns2);
label1.Text = "The collection contains ns2 = " + b.ToString();  
Visual BasicCopy Code
Dim nsc As New FarPoint.Win.Spread.NamedStyleCollection()
Dim ns1 As New FarPoint.Win.Spread.NamedStyle("StyleHeaders", "HeaderDefault")
Dim ns2 As New FarPoint.Win.Spread.NamedStyle("StyleData", "DataAreaDefault")
Dim b As Boolean
ns1.BackColor = Color.LightBlue
ns2.BackColor = Color.Gray
nsc.AddRange(New Object() {ns1, ns2})
FpSpread1.NamedStyles = nsc
FpSpread1.ActiveSheet.ColumnHeader.DefaultStyle = nsc(0)
FpSpread1.ActiveSheet.DefaultStyle = nsc(1)
b = nsc.Contains(ns2)
Label1.Text = "The collection contains ns2 = " & b.ToString()

Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

© 2002-2012 ComponentOne, a division of GrapeCity. All Rights Reserved.