Spread Windows Forms 9.0 Product Documentation
IndexOf Method (SheetViewCollection)
Example 


Sheet (SheetView object) for which to return the index
Returns the index of the specified sheet in the collection.
Syntax
'Declaration
 
Public Overridable Function IndexOf( _
   ByVal sheetView As SheetView _
) As Integer
'Usage
 
Dim instance As SheetViewCollection
Dim sheetView As SheetView
Dim value As Integer
 
value = instance.IndexOf(sheetView)
public virtual int IndexOf( 
   SheetView sheetView
)

Parameters

sheetView
Sheet (SheetView object) for which to return the index

Return Value

Zero-based Integer index of sheet in the collection
Example
This example illustrates the use of this member by returning the index of a sheet in the collection.
System.Collections.ArrayList coll = new System.Collections.ArrayList(3); 
FarPoint.Win.Spread.SheetView Sheet1 = new FarPoint.Win.Spread.SheetView();
FarPoint.Win.Spread.SheetView Sheet2 = new FarPoint.Win.Spread.SheetView();
FarPoint.Win.Spread.SheetView Sheet3 = new FarPoint.Win.Spread.SheetView();
coll.AddRange(new Object[] {Sheet1, Sheet2, Sheet3});
fpSpread1.Sheets.AddRange(coll);
fpSpread1.TabStripPolicy = FarPoint.Win.Spread.TabStripPolicy.Always;
listBox1.Items.Add(fpSpread1.Sheets.IndexOf(Sheet2).ToString());
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()
coll.AddRange(New Object() {Sheet1, Sheet2, Sheet3})
FpSpread1.Sheets.AddRange(coll)
FpSpread1.TabStripPolicy = FarPoint.Win.Spread.TabStripPolicy.Always
ListBox1.Items.Add(FpSpread1.Sheets.IndexOf(Sheet2).ToString())
Requirements

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

See Also

Reference

SheetViewCollection Class
SheetViewCollection Members

 

 


Copyright © GrapeCity, inc. All rights reserved.