How to create color dialog box in VB.NET

Color Dialog

To provide the Color dialog box to your application on the Toolbox, you can click the ColorDialog button and click anywhere on the form. The Color dialog box is implemented through the ColorDialog class.

ShowDialog()method

To display the dialog box to the user, call the ShowDialog() method.

FullOpen property:

You can control the regular or full size of the dialog using the Boolean FullOpen property. When its value is False, which is the default, the dialog appears regularly. If you want it to appear in its full size, set this property to True.

For example:

click the ColorDialog button from toolbox and take two control text box and button to the form and make the multiline textbox.

Now, double click on the button named color in the form and write the following code. 


Private Sub cmdColor_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdColor.Click

        ColorDialog1.FullOpen = True

        ColorDialog1.ShowDialog()

        textBox4.ForeColor = ColorDialog1.Color

    End Sub