Farbschema: Dunkel
Sie befinden sich hier: start » en » Documentation » Microsoft Access development tools » WKL Forms Object Library » WKL Forms Object Library API reference » WklFormatRules

WklFormatRules

WklFormatRules class

Signature

Dim myWklFormatRules As WklFormatRules

Summary

The conditional formatting rules of a tree list.

Parameters

None

Remarks

Returned by WklTreeList.FormatRules. Supports For Each. Rules are checked in collection order; a matching rule with StopIfTrue ends the check.

Not created directly; returned by other members of the library.

MemberKindSummary
`Item`PropertyReturns a rule by position.
`Count`PropertyReturns the number of rules.
`Add`MethodAdds a rule for the value of a column: a comparison, a data bar or an icon set.
`AddExpression`MethodAdds a rule with an expression in Access syntax.
`Remove`MethodRemoves a rule.
`Clear`MethodRemoves all rules.

Code example

With Me!List1.Object.FormatRules
    .Add("Price", wrkValue, wroGreater, 30).Bold = True
    .AddExpression("[Quantity] < [MinimumStock]").ForeColor = vbRed
End With

Inheritance

None

Item property

Signature

Property Get Item(ByVal Index As Long) As WklFormatRule

Summary

Returns a rule by position.

Parameters

NameTypeOptionalDefaultDescription
IndexLongNo–The 0-based position.

Property value: `WklFormatRule` – The rule.

Remarks

Default member: it can be left out, as in myWklFormatRules(...) for myWklFormatRules.Item(...). Read-only.

Code example

None

Inheritance

Declared by WklFormatRules.

Count property

Signature

Property Get Count() As Long

Summary

Returns the number of rules.

Parameters

None

Property value: Long – The number of rules.

Remarks

Read-only.

Code example

None

Inheritance

Declared by WklFormatRules.

Add method

Signature

Function Add(ByVal Column As String, Optional ByVal Kind As WklRuleKind = wrkValue, Optional ByVal Operator As WklRuleOperator = wroEqual, Optional ByVal Value1 As Variant, Optional ByVal Value2 As Variant) As WklFormatRule

Summary

Adds a rule for the value of a column: a comparison, a data bar or an icon set.

Parameters

NameTypeOptionalDefaultDescription
ColumnStringNo–The name of the column whose value is checked and formatted.
Kind`WklRuleKind`YeswrkValueThe kind of rule; default wrkValue.
Operator`WklRuleOperator`YeswroEqualThe comparison for wrkValue; default wroEqual.
Value1VariantYes–The value to compare with.
Value2VariantYes–The upper limit for wroBetween and wroNotBetween.

Return value: `WklFormatRule` – The new rule; set its format properties (ForeColor, Bold …) on it.

Remarks

None

Code example

None

Inheritance

Declared by WklFormatRules.

AddExpression method

Signature

Function AddExpression(ByVal Expression As String, Optional ByVal Column As String = "") As WklFormatRule

Summary

Adds a rule with an expression in Access syntax.

Parameters

NameTypeOptionalDefaultDescription
ExpressionStringNo–The expression, for example [Quantity] < [MinimumStock]; field names in square brackets.
ColumnStringYes""The column to format; empty to format the whole record.

Return value: `WklFormatRule` – The new rule.

Remarks

None

Code example

None

Inheritance

Declared by WklFormatRules.

Remove method

Signature

Sub Remove(ByVal Index As Long)

Summary

Removes a rule.

Parameters

NameTypeOptionalDefaultDescription
IndexLongNo–The 0-based position.

Remarks

None

Code example

None

Inheritance

Declared by WklFormatRules.

Clear method

Signature

Sub Clear()

Summary

Removes all rules.

Parameters

None

Remarks

None

Code example

None

Inheritance

Declared by WklFormatRules.

en/wiki/msaccess/comctl/api-reference/wklformatrules.txt · Zuletzt geändert: von Wolfgang van der Stille