Lesson3 (11/12)

Setting the BackColor Property

You can set the BackColor property at run-time in 2 ways.
Way 1: Using the Color's numeric value
Every color has numeric value.You can simply assign this value to the BackColor property.For example, The numeric value of the red color is &H000000FF&If you want to set the Form BackColor property to red,use the following code:
Command1.BackColor = &H000000FF&

You can find what is the numeric value of everycolor by making the following simple steps:Click on the BackColor property arrow buttonin the properties window (Figure 10).

Then click on the Palette Tab (Figure 11).

Select your desirable color (Figure 12).

The color value will be displayed in the BackColor Property cell (Figure 13).

And once again, if you setting a Command Button's color,don't forget to set its Style property to 1 - Graphical.To learn the second way, you'll have to learna little bit about Constants.All of this in the next page...