You can see an example using Color dialogs on the CD-ROM; it's named ColorDialog. This example lets the user use a Color dialog to set the background color of a label control. In code, all you have to do is to assign the Color object returned by the dialog box's Color property to the label's BackColor property like this-I'm also changing the label's text (originally "Change my color!") to "Here's my new color!" for a little additional excitement:
The Color dialog that this example displays appears in Figure 9.6. You can use it to set the new background color of the label, as you see in Figure 9.20. You can't see it in the black-and-white figure, but I've set the background color to an appealing aqua blue there.