Visual Basic (Declaration) | |
---|---|
Public Property ComparisonOperator As ComparisonOperator |
Visual Basic (Usage) | Copy Code |
---|---|
Dim instance As ConditionalFormat Dim value As ComparisonOperator instance.ComparisonOperator = value value = instance.ComparisonOperator |
C# | |
---|---|
public ComparisonOperator ComparisonOperator {get; set;} |
Property Value
ComparisonOperator object containing the comparison operatorThis example returns the first condition.
C# | Copy Code |
---|---|
FarPoint.Web.Spread.NamedStyle styleCold = new FarPoint.Web.Spread.NamedStyle(); FarPoint.Web.Spread.NamedStyle styleCool = new FarPoint.Web.Spread.NamedStyle(); FarPoint.Web.Spread.NamedStyle styleMild = new FarPoint.Web.Spread.NamedStyle(); FarPoint.Web.Spread.NamedStyle styleWarm = new FarPoint.Web.Spread.NamedStyle(); FarPoint.Web.Spread.NamedStyle styleHot = new FarPoint.Web.Spread.NamedStyle(); styleCold.BackColor = Color.Blue; styleCold.ForeColor = Color.White; styleCool.BackColor = Color.Cyan; styleMild.BackColor = Color.Lime; styleWarm.BackColor = Color.Yellow; styleHot.BackColor = Color.Red; FarPoint.Web.Spread.ComparisonOperator co = new FarPoint.Web.Spread.ComparisonOperator(); FpSpread1.ActiveSheetView.SetConditionalFormat(1, 1, styleCold, FarPoint.Web.Spread.ComparisonOperator.LessThan, "32"); FpSpread1.ActiveSheetView.SetConditionalFormat(1, 1, styleCool, FarPoint.Web.Spread.ComparisonOperator.Between, "32", "55"); FpSpread1.ActiveSheetView.SetConditionalFormat(1, 1, styleMild, FarPoint.Web.Spread.ComparisonOperator.Between, "55", "75"); FpSpread1.ActiveSheetView.SetConditionalFormat(1, 1, styleWarm, FarPoint.Web.Spread.ComparisonOperator.Between, "75", "85"); FpSpread1.ActiveSheetView.SetConditionalFormat(1, 1, styleHot, FarPoint.Web.Spread.ComparisonOperator.GreaterThan, "85"); FpSpread1.ActiveSheetView.Cells[1, 1].Value = 38; FarPoint.Web.Spread.ConditionalFormat[] cf; FarPoint.Web.Spread.ConditionalFormat item = new FarPoint.Web.Spread.ConditionalFormat(styleCool); cf = FpSpread1.ActiveSheetView.GetConditionalFormats(1, 1, false); foreach (int item in cf) { string msg = "The first condition is " + item.FirstCondition.ToString(); Response.Write("alert('" + msg + "')"); } |
Visual Basic | Copy Code |
---|---|
Dim styleCold As New FarPoint.Web.Spread.NamedStyle Dim styleCool As New FarPoint.Web.Spread.NamedStyle Dim styleMild As New FarPoint.Web.Spread.NamedStyle Dim styleWarm As New FarPoint.Web.Spread.NamedStyle Dim styleHot As New FarPoint.Web.Spread.NamedStyle styleCold.BackColor = Color.Blue styleCold.ForeColor = Color.White styleCool.BackColor = Color.Cyan styleMild.BackColor = Color.Lime styleWarm.BackColor = Color.Yellow styleHot.BackColor = Color.Red Dim co As New FarPoint.Web.Spread.ComparisonOperator FpSpread1.ActiveSheetView.SetConditionalFormat(1, 1, styleCold, FarPoint.Web.Spread.ComparisonOperator.LessThan, "32") FpSpread1.ActiveSheetView.SetConditionalFormat(1, 1, styleCool, FarPoint.Web.Spread.ComparisonOperator.Between, "32", "55") FpSpread1.ActiveSheetView.SetConditionalFormat(1, 1, styleMild, FarPoint.Web.Spread.ComparisonOperator.Between, "55", "75") FpSpread1.ActiveSheetView.SetConditionalFormat(1, 1, styleWarm, FarPoint.Web.Spread.ComparisonOperator.Between, "75", "85") FpSpread1.ActiveSheetView.SetConditionalFormat(1, 1, styleHot, FarPoint.Web.Spread.ComparisonOperator.GreaterThan, "85") FpSpread1.ActiveSheetView.Cells(1, 1).Value = 38 Dim cf As FarPoint.Web.Spread.ConditionalFormat() Dim item As New FarPoint.Web.Spread.ConditionalFormat(styleCool) cf = FpSpread1.ActiveSheetView.GetConditionalFormats(1, 1, False) For Each item In cf Dim msg As String = "The first condition is " & item.FirstCondition.ToString() Response.Write("alert('" & msg & "')") Next |
Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family