Spread Windows Forms 7.0 Product Documentation
Working with the Active Sheet
Support Options
Spread Windows Forms 7.0 Product Documentation > Developer's Guide > Understanding the Spreadsheet Objects > Working with Sheets > Working with the Active Sheet

Glossary Item Box

The active sheet is the sheet that currently receives any user interaction. You can specify the active sheet programmatically by using the ActiveSheet property of the FpSpread object. You can also specify the index of the active sheet by using the ActiveSheetIndex property.

Usually, the active sheet is displayed on top of other sheets.

Using a Shortcut

You can use ActiveSheet as a shortcut object for the active sheet when specifying properties of the sheet.

Example

Set properties of the active sheet and assign the active sheet to sheet number 2.

C# Copy Code
// Allow three sheets in the component.
fpSpread1.Sheets.Count = 3;
// Set third sheet (in zero-based index) be set to active sheet.
fpSpread1.ActiveSheetIndex = 2;
// Set some properties of the active sheet.
fpSpread1.ActiveSheet.ColumnCount = 8;
fpSpread1.InterfaceRenderer = NULL;
fpSpread1.ActiveSheet.GrayAreaBackColor = Color.Purple;
VB Copy Code
' Allow three sheets in the component.
FpSpread1.Sheets.Count = 3
' Set third sheet (in zero-based index) be set to active sheet.
FpSpread1.ActiveSheetIndex = 2
' Set some properties of the active sheet.
FpSpread1.ActiveSheet.ColumnCount = 8
FpSpread1.InterfaceRenderer = Nothing
FpSpread1.ActiveSheet.GrayAreaBackColor = Color.Purple

© 2002-2014 ComponentOne, a division of GrapeCity. All Rights Reserved.