Spread Windows Forms 6.0 Product Documentation
IsEmpty Method
See Also  Example Support Options
FarPoint.Win.Spread Assembly > FarPoint.Win.Spread.Model Namespace > BaseSheetSelectionModel Class : IsEmpty Method


Glossary Item Box

Determines whether the model has no selections.

Syntax

Visual Basic (Declaration) 
Public Overridable Function IsEmpty() As Boolean
Visual Basic (Usage)Copy Code
Dim instance As BaseSheetSelectionModel
Dim value As Boolean
 
value = instance.IsEmpty()
C# 
public virtual bool IsEmpty()

Return Value

Boolean: true if no selections in the selection model; false otherwise

Example

This example changes the color of selections if the model is not empty.
C#Copy Code
FarPoint.Win.Spread.Model.BaseSheetSelectionModel selModel; 
selModel = (FarPoint.Win.Spread.Model.BaseSheetSelectionModel)fpSpread1.ActiveSheet.Models.Selection; 
selModel.SetSelection(0, 0, 3, 3);

bool b;
b = selModel.IsEmpty();
if(b == false)
{
       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.SelectionBackColor = Color.Yellow;
}
Visual BasicCopy Code
Dim selModel As FarPoint.Win.Spread.Model.BaseSheetSelectionModel
selModel = FpSpread1.ActiveSheet.Models.Selection
selModel.SetSelection(0, 0, 3, 3)

Dim b As Boolean
b = selModel.IsEmpty()
If b = False Then
       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.SelectionBackColor = Color.Yellow
End If

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.