Excerpt |
---|
Returns the Condition object at the specified 0-based index. |
Signature |
---|
C# | C# | Wiki Markup |
---|
{description}
{excerpt}Returns the [Condition|Condition] object at the specified 0\-based index. {excerpt}
{signature:C#}
public Condition this[int index] { get; }
|
Signature |
---|
{signature}{signature:vb.net | vb.net | }
Public Default ReadOnly Property Item(ByVal index As Integer) As Condition
|
...
The 0-based index of the Condition
object.
Remarks |
---|
The index determines the order in which conditions will be evaluated. A ConditionalFormat may contain up to three Condition objects. |
Example |
---|
Code Block |
---|
| csharp | csharp |
title | C# |
---|
{signature}
{parameters}
{param:index}The 0\-based index of the {{Condition}} object.{param}
{remarks}
The index determines the order in which conditions will be evaluated. A [ConditionalFormat|ConditionalFormat] may contain up to three {{Condition}} objects.
{remarks}
{example}{code:csharp|title=C#}
ExcelApplication xla = new ExcelApplication();
Workbook wb = xla.Create();
//--- Create a range of the cells that will have the conditional formatting.
Range vRange = wb.Worksheets[0].CreateRange("$B$2:$F$10");
Area vArea = vRange.Areas[0];
//--- Get the conditional format for the first cell within this range.
ConditionalFormat vCndFmt = vArea[0,0].ConditionalFormat;
//--- Modify the first condition.
Condition vCondition = vCondFmt.Condition[0];
vCondition.ChangeConditionType(Condition.Comparison.CellValueLessThan, "=100");
vRange.SetConditionalFormat(vCondFmt);
Code Block |
---|
{code}
{code:vb.net
vb.net | title | |title=vb.net
}
Dim xla As New ExcelApplication()
Dim wb As Workbook = xla.Create()
'--- Create a range of the cells that will have the conditional formatting.
Dim rng As Range = wb.Worksheets(0).CreateRange("$B$2:$F$10")
Dim ar As Area = rng.Areas(0)
'--- Get the conditional format for the first cell within this range.
Dim CondFmt As ConditionalFormat = ar(0,0).ConditionalFormat
'--- Modify the first condition.
Dim cond As Condition = CondFmt.Condition(0)
cond.ChangeConditionType(Condition.Comparison.CellValueLessThan, "=100")
rng.SetConditionalFormat(vCndFmt)
{code}
{example}