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

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
// Create 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
' Create 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