The active sheet is the sheet that currently receives any user interaction and displays on top of other sheets. 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.
You can use ActiveSheet as a shortcut object for the active sheet when specifying properties of the sheet.
The following 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 |