Properties of Color Dialog Control
The Kettic Color Dialog WinForm component offers the easy way to customize color to Form via choosing color from a color palette. This is a light weight user interface WinForms control and can be seamlessly integrated into other controls. RGB or HEX color models are available for choosing color. The color palette that can be themed as demand contains large flexibility to build custom color from the web, system, and basic colors.
Color Dialog Key Properties
The following are the key properties of the Color Dialog that provide richer color functionalities that the standard Windows Forms color tools.
- ActiveMode, this is a property used to configure the tab that is selected currently, whose valid values include Basic Color, System Color, Web Color and Professional Color.
- BackColor, the property is able to set the background color of the color selector. The Transparent property will blend in the color with UI elements.
- ForeColor, this property is used to determine the fore color of labels and text entry.
- AllowColorPickFromScreen, this is a property used to display the eye dropper tool
- AllowColorSaving, this is a property used to visualize the add a custom color button
- SelectedColor, this property is used to label the color that users selected
- OldColor, this property is used to label the color that users used.
- DisplayEditHEXValue, the hexadecimal entry of color values will be enabled when set the value as true.
- To display the color tabs, enable the properties, DispalyBasicColors, DispalySystemColors, DispalyWebColors, and DispalyProfessionalColors.
- DisplayHEXColorValue, the hexadecimal entry of color values will be displayed when set the values as true.
private void button_Click(object sender, EventArgs e)
StringBuilder sb = new StringBuilder();
foreach (Color color in colorDialog.CustomColors)
To customize the text values of Color Dialog control for localization, we can use these localizing properties including AddTextToColorButton, SystemTabHeading, ProfessionalTabHeading, BasicTabHeading, WebTabHeading, OldColorLabelHeading and SelectedColorLabelHeading.
How to Get Selected Colors
The C# code snippet below shows how to get the SelectedColor or the SelectedHlsColor that users can use in their .NET Windows Form project
if (colorDialog.DisplayDialog() == DialogResult.OK)
Color color = colorDialog.SelectedColor;
HslColor hslColor = colorDialog.SelectedHslColor;