How It Works
This time you did not need to set any properties of the ColorDialog control, so you jumped right in and displayed it in an If . . . End If statement to check the DialogResult returned by the ShowDialog method of this dialog box:
‘Show the Color dialog
If ColorDialog1.ShowDialog = Windows.Forms.DialogResult.OK Then |
Within the If . . . End If statement, you added the code necessary to change the BackColor property of the form. Once the BackColor property was changed, each Button control on the form inherited the background color of the form; there was no code that you needed to write for this. The reason behind this is that the Button class is part of the System.Windows.Forms.Control namespace; thus, it automatically inherits the background color of the form:
‘Set the BackColor property of the form
Me.BackColor = ColorDialog1.Color |
click next Page - The PrintDialog Control. |