Spread Windows Forms 8.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 instructions for applying the built-in sheet skins, see Applying a Skin to a Sheet.
For more information on cell-level styles, refer to Creating and Applying a Style for Cells.
For instructions on saving the sheet skin to a file or stream, refer to Saving and Loading a Skin.
For information on the underlying model for skins, refer to Understanding the Style Model.
For information on customizing a skin in the Spread Designer, refer to explanation of the SheetSkin editor in the Spread Designer Guide.
For more details about sheet skins, refer to the SheetSkin class.
A dialog appears saying the skin has been saved.
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)) |
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 |
A message box appears telling you your custom skin has been saved.