Spread Windows Forms 8.0 Product Documentation > Developer's Guide > Understanding the Spreadsheet Objects > Working with Sheets > Moving a Sheet |
If you have multiple sheets, you can move a sheet. If you move the first sheet location to the last sheet location, then the other sheets are moved to the left. If you move from one sheet to a sheet next to it, then this behaves in a manner similar to a swap. The sheet index is zero‑based. Specify the from and to location using the sheet index. Moving a sheet does not change the sheet name.
The AllowSheetMove property of the FpSpread class can be set to true to allow the user to move the sheets using the sheet tabs. You can also hide a sheet. For more information, refer to Showing or Hiding a Sheet.To move an existing sheet, complete the following instructions.
Call the Sheets Move method (to move the sheet from one location to another).
This example code moves the second sheet to the location of the third sheet.
C# |
Copy Code
|
---|---|
// Move sheet 2 to the location of sheet 3.
FpSpread1.Sheets.Count = 5;
FpSpread1.Sheets.Move(2, 3);
|
VB |
Copy Code
|
---|---|
' Move sheet 2 to the location of sheet 3.
FpSpread1.Sheets.Count = 5
FpSpread1.Sheets.Move(2, 3)
|