Library tutorials & articles
Label Control
- Introduction
- Properties and Events
- Setting the text
- Setting the background colour
- Setting the text colour
Setting the background colour
Normally, you will just set the background colour at design time, using the properties window, however, you can also set the background colour by changing the BackColor property:
Label1.BackColor = ColourCode
Visual Basic uses Hexadecimal code to specify control colours, for example &H80000006& is black. Unless you want to learn hexadecimal code you can use the QBColor Function.
Label1.BackColor = QBColor(Number)
Where number is one of the following:
|
Number |
Colour |
|
0 |
Black |
|
1 |
Blue |
|
2 |
Green |
|
3 |
Cyan |
|
4 |
Red |
|
5 |
Magenta |
|
6 |
Yellow |
|
7 |
White |
|
8 |
Grey |
|
9 |
Light Blue |
|
10 |
Light Green |
|
11 |
Light Cyan |
|
12 |
Light Red |
|
13 |
Light Magenta |
|
14 |
Light Yellow |
|
15 |
Bright White |
The following code sets the background colour of Label1 to Red.
Label1.BackColor = QBColor(4)
Related articles
Related discussion
-
VB6 Runtime error 381 subsript out of range Error
by Uncle (2 replies)
-
passing and reading parameters from using Shell
by jigartoliya (0 replies)
-
Convert C++ code to VB6
by mawcot (4 replies)
-
listbox scrollbar
by Dennijr (10 replies)
-
Can you describe Above simple VB6 code?
by pramodmca09 (0 replies)
Related podcasts
-
Christian Beauclair
14 mai 2008 (�mission #0074) ::.Christian Beauclair: Stratégies de migration VB6 vers .NET Nous discutons avec Christian Beauclair des stratégies de migration VB6 vers .NET. Entre autres, nous discutons comment utiliser le "VB 6 Code Advisor" et le "Interop Forms Toolkit" pour ajouter la puiss...
This thread is for discussions of Label Control.