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 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 |
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.