Spread Windows Forms 8.0 Product Documentation
SelectionForeColor Property (SheetView)
Example 


Gets or sets the foreground color of selections on this sheet.
Syntax
'Declaration
 
Public Property SelectionForeColor As Color
'Usage
 
Dim instance As SheetView
Dim value As Color
 
instance.SelectionForeColor = value
 
value = instance.SelectionForeColor
public Color SelectionForeColor {get; set;}

Property Value

Color object containing the text color for selected cells
Remarks

The setting of this property is used for the text color of selections if the SelectionStyle property is set to SelectionStyles.SelectionColors or SelectionStyles.Both. This property has no effect if the SelectionStyle property is set to SelectionStyles.None or SelectionStyles.SelectionRenderer.

To set the selection background color, set the SelectionBackColor property.

For more information, see Customizing Selection Appearance.

Example
This example specifies the selection policy for the sheet for normal operation mode, and sets the background color and text color for selections.
fpSpread1.ActiveSheet.SelectionStyle = FarPoint.Win.Spread.SelectionStyles.SelectionColors;
fpSpread1.ActiveSheet.SelectionPolicy = FarPoint.Win.Spread.Model.SelectionPolicy.Range;
fpSpread1.ActiveSheet.SelectionUnit = FarPoint.Win.Spread.Model.SelectionUnit.Cell;
fpSpread1.ActiveSheet.AddSelection(0, 0, 2, 2);
fpSpread1.ActiveSheet.AddSelection(3, 0, 2, 2);
fpSpread1.ActiveSheet.SelectionBackColor = Color.Red;
fpSpread1.ActiveSheet.SelectionForeColor = Color.DarkBlue;
FpSpread1.ActiveSheet.SelectionStyle = FarPoint.Win.Spread.SelectionStyles.SelectionColors
FpSpread1.ActiveSheet.SelectionPolicy = FarPoint.Win.Spread.Model.SelectionPolicy.Range
FpSpread1.ActiveSheet.SelectionUnit = FarPoint.Win.Spread.Model.SelectionUnit.Cell
FpSpread1.ActiveSheet.AddSelection(0, 0, 2, 2)
FpSpread1.ActiveSheet.AddSelection(3, 0, 2, 2)
FpSpread1.ActiveSheet.SelectionBackColor = Color.Red
FpSpread1.ActiveSheet.SelectionForeColor = Color.DarkBlue
Requirements

Target Platforms: Windows 2000 Professional (SP4), Windows 2000 Server, Windows 2003 Server (SP1), Windows 2008, Windows XP (SP2), Windows Vista, Windows 7, Windows 8

See Also

Reference

SheetView Class
SheetView Members
SelectionBackColor Property
SelectionStyle Property

User-Task Documentation

Customizing the Selection Indicator

 

 


Copyright © GrapeCity, inc. All rights reserved.