Spread Windows Forms 12.0 Product Documentation
ComparedOperator Property (CompareStringValidator)
Example 


FarPoint.Win.Spread Assembly > FarPoint.Win.Spread Namespace > CompareStringValidator Class : ComparedOperator Property
Gets or sets the compared operator.
Syntax
'Declaration
 
Public Property ComparedOperator As CompareStringValidatorOperator
'Usage
 
Dim instance As CompareStringValidator
Dim value As CompareStringValidatorOperator
 
instance.ComparedOperator = value
 
value = instance.ComparedOperator
public CompareStringValidatorOperator ComparedOperator {get; set;}

Property Value

The compared operator. The default is CompareStringValidatorOperator.Equals.
Exceptions
ExceptionDescription
The assigned value is not defined in CompareStringValidatorOperator.
Example
This example displays an icon if the cell value is invalid.
//Type a value in cell 1,1
FarPoint.Win.Spread.IconNotify iconn = new FarPoint.Win.Spread.IconNotify();
iconn.Icon = new System.Drawing.Icon("C:\\Program Files (x86)\\GrapeCity\\spread.ico");
iconn.IconAlignment = ContentAlignment.MiddleCenter;
iconn.IconTip = "Must contain Test";
FarPoint.Win.Spread.CompareStringValidator svalid = new FarPoint.Win.Spread.CompareStringValidator();
svalid.ComparedOperator = FarPoint.Win.Spread.CompareStringValidatorOperator.Contains;
svalid.ComparedString = "Test";
svalid.Actions.Add(iconn);
fpSpread1.Sheets[0].AddValidators(new FarPoint.Win.Spread.Model.CellRange(1, 1, 1, 1), svalid);
fpSpread1.Sheets[0].Columns[1].Width = 140;
fpSpread1.Sheets[0].Rows[1].Height = 50;
'Type a value in cell 1,1
Dim iconn As New FarPoint.Win.Spread.IconNotify()
iconn.Icon = New System.Drawing.Icon("C:\Program Files (x86)\GrapeCity\spread.ico")
iconn.IconAlignment = ContentAlignment.MiddleCenter
iconn.IconTip = "Must contain Test"
Dim svalid As New FarPoint.Win.Spread.CompareStringValidator()
svalid.ComparedOperator = FarPoint.Win.Spread.CompareStringValidatorOperator.Contains
svalid.ComparedString = "Test"
svalid.Actions.Add(iconn)
FpSpread1.Sheets(0).AddValidators(New FarPoint.Win.Spread.Model.CellRange(1, 1, 1, 1), svalid)
FpSpread1.Sheets(0).Columns(1).Width = 140
FpSpread1.Sheets(0).Rows(1).Height = 50
See Also

Reference

CompareStringValidator Class
CompareStringValidator Members