Skip to content

Display known system colors for ARGB colors in the WinForms ColorEdit control.

License

Notifications You must be signed in to change notification settings

DevExpress-Examples/winforms-coloredit-display-knowncolor-for-argb-colors

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Winforms Color Editor - Display known system colors for ARGB colors

This example creates a custom color editor and overrides the RepositoryItemColorEdit.GetColorDisplayText method. The example also uses a helper class to convert a color in any format to a known system color.

Winforms Color Editor - Display known system colors for ARGB colors

public class RepositoryItemMyColorEdit : RepositoryItemColorEdit {
    // ...
    protected override string GetColorDisplayText(Color editValue) {
        object color = editValue;
        ColorHelper.TryConvertToKnownColor(ref color);
        return base.GetColorDisplayText((Color)color);
    }
}

Files to Review

Documentation

Does this example address your development requirements/objectives?

(you will be redirected to DevExpress.com to submit your response)