FormatConditions 属性

       

使用 FormatConditions 属性可以返回对 FormatConditions 集合及其相关属性的只读引用。

expression.FormatConditions

expression  必需。返回“Applies To”列表中的一个对象的表达式。

说明

该属性仅在使用 Visual Basic 时才可用。

也可以在“条件格式”对话框中设置组合框或文本框的条件格式。当窗体处于“设计”视图时,单击“格式”菜单中的“条件格式”,可以打开“条件格式”对话框。

示例

下面的示例设置“Textbox1”控件现有条件格式的格式属性。

With forms("forms1").Controls("Textbox1").FormatConditions(1)
    .BackColor = RGB(255,255,255)
    .FontBold = True
    .ForeColor = RGB(255,0,0)
End With