背景色属性 (Microsoft Forms)BackColor property (Microsoft Forms)

指定对象的背景色Specifies the background color of the object.

语法Syntax

对象背景色[= Long ]object.BackColor [= Long ]

BackColor 属性语法包含以下部分:The BackColor property syntax has these parts:

PartPart 说明Description
objectobject 必需。Required. 一个有效的对象。A valid object.
LongLong 可选。Optional. 确定对象的背景色的常量的值。A value or constant that determines the background color of an object.

设置Settings

您可以使用任何表示有效颜色的整数。You can use any integer that represents a valid color. 您还可以使用带有红色、绿色和蓝色分量的 RGB 函数指定颜色。You can also specify a color by using the RGB function with red, green, and blue color components. 每个颜色分量的值都是一个范围在 0 和 255 之间的整数。The value of each color component is an integer that ranges from zero to 255. 例如,您可以将青绿色指定为整数值 4966415,或指定为红色、绿色和蓝色分量 (15, 200, 75)。For example, you can specify teal blue as the integer value 4966415 or as red, green, and blue color components 15, 200, 75.

备注Remarks

如果 BackStyle 属性设置为 fmBackStyleOpaque,则只能看到对象的背景色。You can only see the background color of an object if the BackStyle property is set to fmBackStyleOpaque.

另请参阅See also

支持和反馈Support and feedback

有关于 Office VBA 或本文档的疑问或反馈?Have questions or feedback about Office VBA or this documentation? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.