Spread Windows Forms 11.0 Product Documentation
Creating a Custom Skin for a Sheet
Spread Windows Forms 11.0 Product Documentation > Developer's Guide > Customizing the Sheet Appearance > Customizing the Individual Sheet Appearance > Creating a Custom Skin for a Sheet

You can quickly customize the appearance of a sheet by applying a "skin" to it. Some built-in skins are provided with Spread to create common formats. You can create your own custom skin and save it to use again, similar to a template. A skin, whether built-in or custom, can be applied to any number of sheets. Just as a style can be applied to cells, so a skin can be applied to an entire sheet.

For more information and instructions about See
Applying the built-in sheet skins Applying a Skin to a Sheet
Creating and applying your own cell-level styles Creating and Applying a Style for Cells
Saving the sheet skin to a file or stream Saving and Loading a Skin
Underlying model for skins Understanding the Style Model
Customizing a skin in the Spread Designer SheetSkin Editor in the Spread Designer Guide
Sheet skins SheetSkin class

Using the SheetSkin Editor

  1. In the Form window, click the SheetView object for which you want to create the skin.
  2. In the Properties window, in the Appearance category, select the ActiveSkin property and click on the button to launch the SheetSkin Editor.
  3. In the SheetSkin Editor, select the Custom tab.
  4. Set the properties in the Custom tab to create the skin you want.
  5. Set the Name property to specify the name for your custom skin.
  6. Click the Save Skin button to save the skin.

    A dialog appears saying the skin has been saved.

  7. Click OK to close the editor and apply the skin you created to the sheet, or click Cancel to close the editor and not apply the skin you created.

Using a Shortcut

  1. Use the SheetSkin object constructor, and set its parameters to specify the settings for the skin.
  2. Use the Apply method of the SheetSkin object to apply it to the component, a sheet, or a set of sheets.

Example

This example code sets the first sheet to use a custom skin.

C#
Copy Code
// Create a custom skin.
FarPoint.Win.Spread.SheetSkin myskin = new FarPoint.Win.Spread.SheetSkin("MySkin", Color.AliceBlue, Color.BlanchedAlmond, Color.Navy, Color.CornflowerBlue, FarPoint.Win.Spread.GridLines.Both, Color.Coral, Color.Navy, Color.Bisque, Color.Crimson, Color.AntiqueWhite, Color.BlanchedAlmond, true, true, true, true, true);
// Apply the custom skin to the first sheet in the component.
myskin.Apply(fpSpread1.Sheets[0]);
VB
Copy Code
' Create a custom skin.
Dim myskin As New FarPoint.Win.Spread.SheetSkin("MySkin", Color.AliceBlue, Color.BlanchedAlmond, Color.Navy, Color.CornflowerBlue, FarPoint.Win.Spread.GridLines.Both, Color.Coral, Color.Navy, Color.Bisque, Color.Crimson, Color.AntiqueWhite, Color.BlanchedAlmond, True, True, True, True, True)
' Apply the custom skin to the first sheet in the component.
myskin.Apply(fpSpread1.Sheets(0))

Using Code

  1. Call the SheetSkin object constructor, and set its parameters to specify the settings for the skin.
  2. Call the SheetSkin object Apply method to apply it to the component, a sheet, or a set of sheets.

Example

This example code sets the first sheet to use a custom skin.

C#
Copy Code
// Create a custom skin.
FarPoint.Win.Spread.SheetSkin myskin = new FarPoint.Win.Spread.SheetSkin("MySkin", Color.AliceBlue, Color.BlanchedAlmond, Color.Navy, Color.CornflowerBlue, FarPoint.Win.Spread.GridLines.Both, Color.Coral, Color.Navy, Color.Bisque, Color.Crimson, Color.AntiqueWhite, Color.BlanchedAlmond, true, true, true, true, true);
// Create a new SheetView object.
FarPoint.Win.Spread.SheetView newsheet = new FarPoint.Win.Spread.SheetView();
// Apply the custom skin to the SheetView object.
myskin.Apply(newsheet);
// Assign the SheetView object to the first sheet in the component.
fpSpread1.Sheets[0] = newsheet;
VB
Copy Code
' Create a custom skin.
Dim myskin As New FarPoint.Win.Spread.SheetSkin("MySkin", Color.AliceBlue, Color.BlanchedAlmond, Color.Navy, Color.CornflowerBlue, FarPoint.Win.Spread.GridLines.Both, Color.Coral, Color.Navy, Color.Bisque, Color.Crimson, Color.AntiqueWhite, Color.BlanchedAlmond, True, True, True, True, True)
' Create a new SheetView object.
Dim newsheet As New FarPoint.Win.Spread.SheetView()
' Apply the custom skin to the SheetView object.
myskin.Apply(newsheet)
' Assign the SheetView object to the first sheet in the component.
fpSpread1.Sheets(0) = newsheet

Using the Spread Designer

  1. Select the sheet tab for the sheet for which you want to set the skin.
  2. From the Settings menu, choose SheetSkin Editor.
  3. In the SheetSkin Editor, select the Custom tab.
  4. Set the properties for the new custom sheet skin, including the Name property to name your skin.
  5. Select the Save Skin button.

    A message box appears telling you your custom skin has been saved.

  6. Click OK to close the Sheet Skin Editor.
  7. From the File menu choose Apply and Exit to apply your changes to the component and exit Spread Designer.