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


name
NamedStyle to find

Glossary Item Box

Finds a style with the specified name in the collection.

Syntax

Visual Basic (Declaration) 
Public Function Find( _
   ByVal name As String _
) As NamedStyle
Visual Basic (Usage)Copy Code
Dim instance As DefaultStyleCollection
Dim name As String
Dim value As NamedStyle
 
value = instance.Find(name)
C# 
public NamedStyle Find( 
   string name
)

Parameters

name
NamedStyle to find

Return Value

NamedStyle object containing the style in the collection with the specified name, or null if no style is found

Example

This example searches the collection for a NamedStyle with the specified name.
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 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.