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


style
NamedStyle to check for in the collection

Glossary Item Box

Determines whether the collection contains the specified style.

Syntax

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

Parameters

style
NamedStyle to check for in the collection

Return Value

Boolean: true if the object is found in the collection; false otherwise

Example

This example determines whether the collection contains the specified NamedStyle object.
C#Copy Code
FarPoint.Win.Spread.DefaultStyleCollection dsc = new FarPoint.Win.Spread.DefaultStyleCollection();
bool b;
foreach(FarPoint.Win.Spread.NamedStyle style in FarPoint.Win.Spread.DefaultStyleCollection.Styles)
{
listBox1.Items.Add(style.Name);
listBox1.SetSelected(0, true);
b = dsc.Contains(dsc.Find(listBox1.SelectedItem.ToString()));
listBox1.Items.Add(b.ToString());
}
Visual BasicCopy Code
Dim dsc As New FarPoint.Win.Spread.DefaultStyleCollection()
Dim style As FarPoint.Win.Spread.NamedStyle
Dim b As Boolean
For Each style In dsc.Styles
ListBox1.Items.Add(style.Name)
ListBox1.SetSelected(0, True)
b = dsc.Contains(dsc.Find(ListBox1.SelectedItem.ToString()))
ListBox1.Items.Add(b.ToString())
Next

Requirements

Target Platforms: Windows 2000 Professional (SP4), Windows 2000 Server, Windows 2003 Server (SP1), Windows 2008, Windows XP (SP2), Windows Vista, Windows 7, Windows 8

See Also

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