FarPoint.Win.Spread
SelectionStyle Property
See Also  Example
FarPoint.Win.Spread Assembly > FarPoint.Win.Spread Namespace > SheetView Class : SelectionStyle Property


Gets or sets how selections on this sheet are drawn.

Syntax

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

Return Value

SelectionStyles setting that determines the style of the selected cells

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

Remarks

When the property is set to SelectionStyles.SelectionRenderer, the selection is drawn using a semitransparent brush (whose settings are alpha=100, and RGB=SystemColors.Highlight). If you set the property to SelectionStyles.Both, the selection is drawn using the semitransparent brush and the colors specified by the SelectionBackColor and SelectionForeColor properties. If you set this property to SelectionStyles.SelectionColors, the selection is drawn using the colors specified by the SelectionBackColor and SelectionForeColor properties.

For more information, see Customizing the Selection Appearance.

See Also