Spread Windows Forms 6.0 Product Documentation
Showing or Hiding a Sheet
Support Options
Spread Windows Forms 6.0 Product Documentation > Developer's Guide > Understanding the Spreadsheet Objects > Working with Sheets > Showing or Hiding a Sheet

Glossary Item Box

If you have more than one sheet in the component, you can hide a sheet so that it is not displayed to the user. Even though it is not displayed, it is not removed from the component. For information on adding a sheet, refer to Adding a Sheet. There must be at least one sheet in the component.

Hiding a sheet does not change the default sheet names provided to the other sheets. For example, a Spread component with three sheets would by default name them Sheet1, Sheet2, and Sheet3. If you hide the second sheet, the names for the remaining sheets are Sheet1 and Sheet3.

Hiding a sheet does not remove it and does not affect formulas on that sheet or references to that sheet. For more information on removing the sheet completely, refer to Removing a Sheet.

For programming details, refer to the Visible property of the SheetView class.

Return to the overview at Working with Sheets.

Using the Properties Window

  1. At design time, in the Properties window, select the Spread component.
  2. Select the Sheets property.
  3. Click the button to display the SheetView Collection Editor.
  4. In the Members list, select the sheet to hide.
  5. Select the Visible property in the property list, and then select false.
  6. Click OK to close the editor.

Using a Shortcut

Set the Sheets shortcut object Visible property for the sheet.

Example

This example code hides the second and fourth sheets from a Spread component that has eight sheets.

C# Copy Code
private void Form1_Load(object sender, System.EventArgs e)
 
  {
 
   
 
  // Set the Spread to have eight sheets.
 
  fpSpread1.Sheets.Count = 8;
 
  
 
  // Hide the second and fourth sheets.
 
  fpSpread1.Sheets[1].Visible = false;
 
  fpSpread1.Sheets[3].Visible = false;
 
   
 
  } 
VB Copy Code
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
 
   
 
  ' Set the Spread to have eight sheets.
 
  FpSpread1.Sheets.Count = 8
 
   
 
  ' Hide the second and fourth sheets.
 
  FpSpread1.Sheets(1).Visible = False
 
  FpSpread1.Sheets(3).Visible = False
 
   
 
End Sub
 


Using the Spread Designer
 Select the sheet tab for the sheet for which you want to set properties. 
In the property list, select the Visible property. 
Select false. 
From the File menu choose Apply and Exit to apply your changes to the component and exit Spread Designer. 
© 2002-2012 ComponentOne, a division of GrapeCity. All Rights Reserved.