Spread Windows Forms 6.0 Product Documentation
CopyTo(Array,Int32) Method
See Also  Example Support Options
FarPoint.Win.Spread Assembly > FarPoint.Win.Spread Namespace > DefaultStyleCollection Class > CopyTo Method : CopyTo(Array,Int32) Method


array
A one-dimensional array into which the elements from ICollection are copied
The array must have zero-based indexing.
index
Zero-based index in array at which to paste styles

Glossary Item Box

Copies the styles in the collection to a specified array at a specified location.

Syntax

Visual Basic (Declaration) 
Public Overloads Sub CopyTo( _
   ByVal array As Array, _
   ByVal index As Integer _
) 
Visual Basic (Usage)Copy Code
Dim instance As DefaultStyleCollection
Dim array As Array
Dim index As Integer
 
instance.CopyTo(array, index)
C# 
public void CopyTo( 
   Array array,
   int index
)

Parameters

array
A one-dimensional array into which the elements from ICollection are copied
The array must have zero-based indexing.
index
Zero-based index in array at which to paste styles

Exceptions

ExceptionDescription
System.ArgumentNullExceptionNo array specified, or specified array is null (Nothing)
System.ArgumentExceptionSpecified array is invalid; must have a rank of one
System.ArgumentExceptionSpecified array is invalid; must have sufficient length
System.IndexOutOfRangeExceptionSpecified index is out of range; must be greater than zero

Example

This example copies the style to the specified index in an array.
C#Copy Code
FarPoint.Win.Spread.DefaultStyleCollection dsc = new FarPoint.Win.Spread.DefaultStyleCollection();
Object[] myarray = new Object[dsc.Count];
FarPoint.Win.Spread.StyleInfo si = new FarPoint.Win.Spread.StyleInfo();
foreach(FarPoint.Win.Spread.NamedStyle style in FarPoint.Win.Spread.DefaultStyleCollection.Styles)
{
listBox1.Items.Add(style.Name);
dsc.CopyTo(myarray,0);
}
Visual BasicCopy Code
Dim dsc As New FarPoint.Win.Spread.DefaultStyleCollection()
Dim style As FarPoint.Win.Spread.NamedStyle
Dim myarray(dsc.Count())
Dim si As New FarPoint.Win.Spread.StyleInfo()
For Each style In dsc.Styles
ListBox1.Items.Add(style.Name)
dsc.CopyTo(myarray, 0)
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.