ColorDialog
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.
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.
-cd22024e624778bd1bac086234aa2712.png)
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:
- C#
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:
-dd17c24402c0016b92493f889f96f2d4.png)
For instructions on how to use a custom template to offer advanced customization of the ColorDialog, see below.