2 // System.Drawing.Design.ColorEditor.cs
5 // Martin Willemoes Hansen (mwh@sysrq.dk)
6 // Andreas Nahr (ClassDevelopment@A-SoftTech.com)
8 // (C) 2003 Martin Willemoes Hansen
9 // (C) 2003 Andreas Nahr
13 using System.ComponentModel;
14 namespace System.Drawing.Design
16 public class ColorEditor : UITypeEditor
24 public override object EditValue (ITypeDescriptorContext context,
25 IServiceProvider provider, object value)
31 public override UITypeEditorEditStyle GetEditStyle (
32 ITypeDescriptorContext context)
34 return UITypeEditorEditStyle.DropDown;
37 public override bool GetPaintValueSupported (
38 ITypeDescriptorContext context)
43 public override void PaintValue (PaintValueEventArgs e)
45 Graphics G = e.Graphics;
48 Color C = (Color) e.Value;
49 G.FillRectangle(new SolidBrush (C), e.Bounds);
51 G.DrawRectangle (Pens.Black, e.Bounds);