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


array
Array to which to copy the sheets
arrayIndex
Array index at which to start pasting the sheets

Glossary Item Box

Copies the sheets in the collection to an array.

Syntax

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

Parameters

array
Array to which to copy the sheets
arrayIndex
Array index at which to start pasting the sheets

Example

This example copies the sheets in the collection to an array.
C#Copy Code
System.Collections.ArrayList coll = new System.Collections.ArrayList(3); 
SheetView Sheet1 = new FarPoint.Win.Spread.SheetView();
SheetView Sheet2 = new FarPoint.Win.Spread.SheetView();
SheetView Sheet3 = new FarPoint.Win.Spread.SheetView();
Object[] myarray = new Object[4]; 
coll.AddRange(new Object[] {Sheet1, Sheet2, Sheet3});
fpSpread1.Sheets.AddRange(coll);
fpSpread1.TabStripPolicy = FarPoint.Win.Spread.TabStripPolicy.Always;
fpSpread1.Sheets.CopyTo(myarray, 0);
listBox1.Items.Add(myarray.GetValue(0).ToString());
Visual BasicCopy Code
Dim coll As New System.Collections.ArrayList(3)
Dim Sheet1 As New FarPoint.Win.Spread.SheetView()
Dim Sheet2 As New FarPoint.Win.Spread.SheetView()
Dim Sheet3 As New FarPoint.Win.Spread.SheetView()
Dim myarray(3)
coll.AddRange(New Object() {Sheet1, Sheet2, Sheet3})
FpSpread1.Sheets.AddRange(coll)
FpSpread1.TabStripPolicy = TabStripPolicy.Always
FpSpread1.Sheets.CopyTo(myarray, 0)
ListBox1.Items.Add(myarray.GetValue(0).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.