Spread Windows Forms 7.0 Product Documentation
LastConditionExpression Property
See Also  Example Support Options
FarPoint.Win.Spread Assembly > FarPoint.Win.Spread Namespace > ConditionalFormat Class : LastConditionExpression Property


Glossary Item Box

Gets or sets the last condition as an expression.

Syntax

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

Property Value

Expression of the last condition

Remarks

For more information about expressions, refer to the FarPoint.CalcEngine and the Formula Reference.

Example

This example returns the expressions for the format.
C#Copy Code
FarPoint.Win.Spread.NamedStyle above = new FarPoint.Win.Spread.NamedStyle();
FarPoint.Win.Spread.NamedStyle below = new FarPoint.Win.Spread.NamedStyle();
above.BackColor = Color.Red;
below.BackColor = Color.Yellow;

FarPoint.CalcEngine.Expression one;
FarPoint.CalcEngine.Expression two;
FarPoint.CalcEngine.Expression oneplustwo;
one = new FarPoint.CalcEngine.DoubleExpression(100.0);
two = new FarPoint.CalcEngine.DoubleExpression(20.0);
oneplustwo = new FarPoint.CalcEngine.BinaryOperatorExpression(FarPoint.CalcEngine.BinaryOperatorInfo.AddOperator, one, two);
fpSpread1.ActiveSheet.SetExpression(1, 1, oneplustwo);

fpSpread1.ActiveSheet.SetConditionalFormat(1, 1, above, FarPoint.Win.Spread.ComparisonOperator.GreaterThan, one, two);
fpSpread1.ActiveSheet.SetConditionalFormat(1, 1, below, FarPoint.Win.Spread.ComparisonOperator.LessThan, one, two);

FarPoint.Win.Spread.ConditionalFormat[]cf;
cf = fpSpread1.ActiveSheet.GetConditionalFormats(1, 1); 
foreach (FarPoint.Win.Spread.ConditionalFormat item in cf) 
{ 
      MessageBox.Show(item.LastConditionExpression.ToString()); 
}
Visual BasicCopy Code
Dim above As New FarPoint.Win.Spread.NamedStyle
Dim below As New FarPoint.Win.Spread.NamedStyle
above.BackColor = Color.Red
below.BackColor = Color.Yellow

Dim one As FarPoint.CalcEngine.Expression
Dim two As FarPoint.CalcEngine.Expression
Dim oneplustwo As FarPoint.CalcEngine.Expression
one = New FarPoint.CalcEngine.DoubleExpression(100.0)
two = New FarPoint.CalcEngine.DoubleExpression(20.0)
oneplustwo = New FarPoint.CalcEngine.BinaryOperatorExpression(FarPoint.CalcEngine.BinaryOperatorInfo.AddOperator, one, two)
FpSpread1.ActiveSheet.SetExpression(1, 1, oneplustwo)

Dim co As New FarPoint.Win.Spread.ComparisonOperator
FpSpread1.ActiveSheet.SetConditionalFormat(1, 1, above, co.GreaterThan, one, two)
FpSpread1.ActiveSheet.SetConditionalFormat(1, 1, below, co.LessThan, one, two)


Dim cf As FarPoint.Win.Spread.ConditionalFormat()
Dim item As New FarPoint.Win.Spread.ConditionalFormat
cf = FpSpread1.ActiveSheet.GetConditionalFormats(1, 1)
For Each item In cf
      MessageBox.Show(item.LastConditionExpression.ToString())
Next

Requirements

Target Platforms: Windows 2000 Professional (SP4), Windows 2000 Server, Windows 2003 Server (SP1), Windows 2008, Windows XP (SP2), Windows Vista, Windows 7, Windows 8

See Also

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