Sign in with Microsoft
Sign in or create an account.
Hello,
Select a different account.
You have multiple accounts
Choose the account you want to sign in with.

傳回代表對應至指定色彩數位之 RGB 色彩代碼的 Long。

語法

QBColor ( 色彩 )

所需的 色彩引數 是範圍 0 到 15 的整數。

設定

色彩 自變數具有下列設定:

Number

色彩

Number

色彩

0

黑色

8

灰色

1

藍色

9

淺藍色

2

綠色

10

淺綠色

3

青色

11

淺色青色

4

紅色

12

淺紅色

5

品紅

13

淺洋紅色

6

黃色

14

淺黃色

7

白色

15

亮白燈


註解

色彩 自變數代表舊版基本 (使用的色彩值,例如 Microsoft Visual Basic for MS-DOS 和基本編譯) 。 傳回的值從最小的位元組開始,指定用於設定Visual Basic for Applications所用 RGB 系統中適當色彩的紅色、綠色和藍色值。

範例

附註: 下列範例示範如何在 Visual Basic for Applications (VBA) 模組中使用此函數。 如需使用 VBA 的詳細資訊,請在 [搜尋] 旁的下拉式清單中選取 [開發人員參考],並在 [搜尋] 方塊中輸入一個或多個字詞。

此範例使用 QBColor 函數,將表單的 BackColor 屬性變更為 MyFormColorCode表示的色彩。 QBColor 接受 0 到 15 之間的整數值。

Sub ChangeBackColor (ColorCode As Integer, _
MyForm As Form)
MyForm.BackColor = QBColor(ColorCode)
End Sub

Need more help?

Want more options?

探索訂閱權益、瀏覽訓練課程、瞭解如何保護您的裝置等等。

社群可協助您詢問並回答問題、提供意見反應,以及聆聽來自具有豐富知識的專家意見。

Was this information helpful?

How satisfied are you with the translation quality?
What affected your experience?
By pressing submit, your feedback will be used to improve Microsoft products and services. Your IT admin will be able to collect this data. Privacy Statement.

Thank you for your feedback!

×