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

QBColor 函数QBColor Function

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

返回一个Long表示与指定的颜色编号相对应的 RGB 颜色代码。语法QBColor (颜色所需的_颜色_参数是 0 15 范围内的整数。设置Color_参数具有以下设置:Returns a Long representing the RGB color code corresponding to the specified color number. SyntaxQBColor(_color) The required colorargument is a whole number in the range 0-15. Settings The color argument has these settings:

编号Number对应颜色Color编号Number对应颜色Color
00黑色Black88灰色Gray
11蓝色Blue99浅蓝色Light Blue
22绿色Green1010浅绿色Light Green
33蓝绿色Cyan1111浅青色Light Cyan
44红色Red1212浅红色Light Red
55洋红色Magenta1313浅洋红色Light Magenta
66黄色Yellow1414浅黄色Light Yellow
77白色White1515亮白色Bright White

备注Color_参数表示的基本 (例如,Microsoft Visual Basic MS-DOS 和基本的编译器) 的早期版本使用的颜色值。从开始的最低有效字节,则返回的值指定用于在使用 Visual Basic for Applications 的 RGB 系统中设置适当的颜色的红色、 绿色和蓝色值。Remarks The _color argument represents color values used by earlier versions of Basic (such as Microsoft Visual Basic for MS-DOS and the Basic Compiler). Starting with the least-significant byte, the returned value specifies the red, green, and blue values used to set the appropriate color in the RGB system used by Visual Basic for Applications.

示例Example

此示例使用QBColor函数来更改中作为窗体的背景色属性MyForm为颜色由ColorCodeQBColor接受 0 到 15 之间的整数值。This example uses the QBColor function to change the BackColor property of the form passed in as MyForm to the color indicated by ColorCode. QBColor accepts integer values between 0 and 15.

Sub ChangeBackColor (ColorCode As Integer, MyForm As Form)
    MyForm.BackColor = QBColor(ColorCode)
End Sub
© 2018 Microsoft