You can set support for XP themes for the cells and graphical elements in the Spread component. The VisualStyles property for the Spread component causes the cells to have the appearance of the XP theme. You can create a manifest file so that the scroll bars have a theme appearance.
By default VisualStyles property is set to Auto, so the graphical cell types paint the way the theme is set to paint (for example the button is themed so you cannot set a background color with the BackColor property). You either need to turn off VisualStyles for the Spread component or create a custom cell type where you override the PaintCell and GetEditorControl methods and then set the VisualStyle property of the Appearance object to off. A third alternative is to leave it "on" for the Spread component but turn it "off" for the individual control (such as the FpProgress control for the progress indicator cell).
Applying a sheet skin causes the VisualStyles property to be set to false.
If you are on Windows XP, then you need to add the following line of code to turn off the XP themes in the Spread.
FpSpread1.VisualStyles = FarPoint.Win.VisualStyles.Off
Setting the VisualStyles property of the Spread to Off should return the look of the Spread to the classic look.
Buttons are not displayed as expected if you have changed the SelectionStyle and have VisualStyles on. The problem is that when VisualStyles are on the certain cell types ignore certain settings, such as the button ignoring the setting of the ButtonColor property. You would need to take that into account and possibly set the SelectionForeColor, for example, to something different. The SelectionColors setting for SelectionStyle is an older style and mixing it with XP themes is not suggested.
The VisualStyles property is used on controls that Spread renders such as the button in the ButtonCellType. The scroll bars are child controls rendered by Visual Studio. To have them render with XP themes, you would need to set up a manifest for your application.
Using the Properties Window
This way of setting the theme support is done at design time and uses the Properties window of Visual Studio .NET.
- Select the Spread component.
- With the properties window open, select the VisualStyles property, and choose an option from the drop-down list.
Using Code
Add a line of code that allows the theme support by setting the VisualStyles property for the Spread component.
Example
This example sets the VisualStyles property to on to allow XP themes.
C# | Copy Code |
---|---|
fpSpread1.VisualStyles = FarPoint.Win.VisualStyles.On; |
VB | Copy Code |
---|---|
FpSpread1.VisualStyles = FarPoint.Win.VisualStyles.On |
Using the Spread Designer
- Select Sheet from the drop-down combo list located on the top right side of the Designer.
- From the Appearance section, select an option for the VisualStyles property.
- From the File menu, select Save and Exit to save the changes.