Spread Windows Forms 6.0 Product Documentation
SelectionBackColor Property
See Also  Example Support Options
FarPoint.Win.Spread Assembly > FarPoint.Win.Spread Namespace > SheetView Class : SelectionBackColor Property


Glossary Item Box

Gets or sets the background color of selections on this sheet.

Syntax

Visual Basic (Declaration) 
Public Property SelectionBackColor As Color
Visual Basic (Usage)Copy Code
Dim instance As SheetView
Dim value As Color
 
instance.SelectionBackColor = value
 
value = instance.SelectionBackColor
C# 
public Color SelectionBackColor {get; set;}

Property Value

Color object containing the background color for selected cells

Remarks

The setting of this property is used for the background 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 text color, set the SelectionForeColor 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.
C#Copy Code
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;
Visual BasicCopy Code
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 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

© 2002-2012 ComponentOne, a division of GrapeCity. All Rights Reserved.