Skip to main content

ColorDialog

WATCH & LEARN0:50 · Animated tutorial
7 scenesPlay, pause, or scrub at your own pace

This class provides a way to prompt the user to select a color. The color can be picked either through a list of preset colors or using the visual picker. Once a color is selected, the details of the new color will be shown in a GroupBox, along with a visual comparison of the old and new color.

info

For a complete list of properties, methods, and events, see the API documentation.

Features​

Custom Colors​

Users can enter a Hex, RGB, or HSB value, select a preset color, or fine-tune a color with the visual picker.

ColorDialog showing color selection options with hex, RGB, and HSB inputs

How To​

Customize the Appearance​

The ColorDialog component can be customized by applying appearances to each individual control within the dialog. This includes the textboxes, picker, and more.

To customize these controls, create a new class that inherits from ColorDialogUI, add the custom ColorDialog constructor, and modify the controls within it:

public partial class CustomFolderBrowserDialogUI : FolderBrowserDialogUI
{
public CustomFolderBrowserDialogUI(FolderBrowserDialog folderDialog) : base(folderDialog)
{
this.HeaderBackColor = Color.Green;
this.buttonOK.BackColor = Color.Green;
this.buttonCancel.BackColor = Color.Green;
}
}

After setting the ColorDialog's DialogTemplate property to the new class, the resulting popup will look like this:

Customized ColorDialog with green theme applied to header and buttons

For instructions on how to use a custom template to offer advanced customization of the ColorDialog, see below.