Table of contents
TOC
折叠目录
展开目录

Line.BorderColor 属性 (访问)Line.BorderColor Property (Access)

office 365 dev account|上次更新日期: 2018/3/13
|
2 参与人员

可以使用边框颜色属性来指定控件的边框的颜色。读/写You can use the BorderColor property to specify the color of a control's border. Read/write Long.

语法Syntax

表达式边框颜色expression. BorderColor

表达式_一个表示对象的变量。_expression A variable that represents a Line object.

注解Remarks

边框颜色属性设置是一个数值表达式,对应于要使用的控件的边框颜色。The BorderColor property setting is a numeric expression that corresponds to the color you want to use for a control's border.

你可以使用控件的默认控件样式或 Visual Basic 中的 DefaultControl 属性来设置该属性的默认值。You can set the default for this property by using a control's default control style or the DefaultControl property in Visual Basic.

只有在其特殊效果属性设为平直或阴影时,控件的边框颜色是可见的。如果特殊效果属性设置为平直或阴影,边框颜色设置更改特殊效果属性设置为平面。A control's border color is visible only when its SpecialEffect property is set to Flat or Shadowed. If the SpecialEffect property is set to something other than Flat or Shadowed, setting the BorderColor property changes the SpecialEffect property setting to Flat.

示例Example

下面的示例使用RGB函数来设置边框颜色背景色前, 景色的值属性txtPastDue文本框。您可以使用 QBColor 函数来设置这些属性。将下列代码放在 Form_Current () 事件中设置控件的显示特性,一旦用户打开窗体或移动到一个新的记录。The following example uses the RGB function to set the BorderColor, BackColor, and ForeColor properties depending on the value of the txtPastDue text box. You can also use the QBColor function to set these properties. Putting the following code in the Form_Current( ) event sets the control display characteristics as soon as the user opens a form or moves to a new record.

Sub Form_Current() 
 Dim curAmntDue As Currency, lngBlack As Long 
 Dim lngRed As Long, lngYellow As Long, lngWhite As Long 

 If Not IsNull(Me!txtPastDue.Value) Then 
 curAmntDue = Me!txtPastDue.Value 
 Else 
 Exit Sub 
 End If 
 lngRed = RGB(255, 0, 0) 
 lngBlack = RGB(0, 0, 0) 
 lngYellow = RGB(255, 255, 0) 
 lngWhite = RGB(255, 255, 255) 
 If curAmntDue > 100 Then 
 Me!txtPastDue.BorderColor = lngRed 
 Me!txtPastDue.ForeColor = lngRed 
 Me!txtPastDue.BackColor = lngYellow 
 Else 
 Me!txtPastDue.BorderColor = lngBlack 
 Me!txtPastDue.ForeColor = lngBlack 
 Me!txtPastDue.BackColor = lngWhite 
 End If 
End Sub

另请参阅See also

概念Concepts

行对象Line Object

© 2018 Microsoft