Name
ColorDialog
Synopsis
This common dialog allows you to present a standard interface to
allow the user to select and define a color. You can programmatically
show or hide the custom color definition part of the dialog by
default by specifying the FullOpen property, and
you can predefine the set of custom colors by using the
CustomColors property. Unfortunately, this betrays
its interop origins, because the colors have to be specified as
Int32 values encapsulating the ARGB color, rather
than as an array of System.Drawing.Color values.
You can retrieve the user’s selection through the
System.Drawing.Color property.
public class ColorDialog : CommonDialog { // Public Constructors public ColorDialog(); // Public Instance Properties public virtual bool AllowFullOpen{set; get; } public virtual bool AnyColor{set; get; } public Color Color{set; get; } public int[ ] CustomColors{set; get; } public virtual bool FullOpen{set; get; } public virtual bool ShowHelp{set; get; } public virtual bool SolidColorOnly{set; get; } // Protected Instance Properties protected virtual IntPtr Instance{get; } protected virtual int Options{get; } // Public Instance Methods public override void Reset(); // overrides CommonDialog public override string ToString(); // overrides System.ComponentModel.Component // Protected Instance Methods protected override bool RunDialog(IntPtr hwndOwner); // overrides CommonDialog }
Hierarchy
System.Object
→ System.MarshalByRefObject → System.ComponentModel.Component(System.ComponentModel.IComponen, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access