/// <summary> /// Initializes a new instance of the ColorPicker class with default settings /// </summary> public ColorPicker(ColorCellEditor editor) { if (editor == null) { throw new ArgumentNullException("editor", "editor cannot be null"); } this.editor = editor; this.webHeightSet = false; this.systemHeightSet = false; this.tabControl = new TabControl(); this.customTabPage = new ThemedTabPage(); this.palette = new ColorPalette(editor); this.webTabPage = new ThemedTabPage(); this.webListBox = new ColorListBox(); this.systemTabPage = new ThemedTabPage(); this.systemListBox = new ColorListBox(); this.tabControl.SuspendLayout(); this.SuspendLayout(); // // tabControl1 // this.tabControl.Controls.Add(this.customTabPage); this.tabControl.Controls.Add(this.webTabPage); this.tabControl.Controls.Add(this.systemTabPage); this.tabControl.Location = new System.Drawing.Point(0, 0); this.tabControl.Name = "tabControl"; this.tabControl.SelectedIndex = 0; this.tabControl.Size = new Size(this.DefaultSize.Width - 2, this.DefaultSize.Height - 2); this.tabControl.TabIndex = 0; this.tabControl.TabStop = false; this.tabControl.GotFocus += new EventHandler(tabControl_GotFocus); // // customTabPage // this.customTabPage.Location = new System.Drawing.Point(4, 22); this.customTabPage.Name = "customTabPage"; this.customTabPage.Size = new System.Drawing.Size(192, 214); this.customTabPage.TabIndex = 0; this.customTabPage.Text = "Custom"; this.customTabPage.Controls.Add(this.palette); // // palette // this.palette.Dock = DockStyle.Fill; this.palette.Picked += new EventHandler(this.OnPalettePick); this.palette.KeyPress += new KeyPressEventHandler(this.editor.OnKeyPress); // // webTabPage // this.webTabPage.Location = new System.Drawing.Point(4, 22); this.webTabPage.Name = "webTabPage"; this.webTabPage.Size = new System.Drawing.Size(192, 214); this.webTabPage.TabIndex = 1; this.webTabPage.Text = "Web"; this.webTabPage.Controls.Add(this.webListBox); // // webListBox // this.webListBox.DrawMode = DrawMode.OwnerDrawFixed; this.webListBox.BorderStyle = BorderStyle.FixedSingle; this.webListBox.IntegralHeight = false; this.webListBox.Sorted = false; this.webListBox.Dock = DockStyle.Fill; this.webListBox.Click += new EventHandler(OnListClick); this.webListBox.DrawItem += new DrawItemEventHandler(OnListDrawItem); this.webListBox.KeyDown += new KeyEventHandler(OnListKeyDown); this.webListBox.KeyPress += new KeyPressEventHandler(this.editor.OnKeyPress); // // systemTabPage // this.systemTabPage.Location = new System.Drawing.Point(4, 22); this.systemTabPage.Name = "systemTabPage"; this.systemTabPage.Size = new System.Drawing.Size(192, 214); this.systemTabPage.TabIndex = 2; this.systemTabPage.Text = "System"; this.systemTabPage.Controls.Add(this.systemListBox); // // systemListBox // this.systemListBox.DrawMode = DrawMode.OwnerDrawFixed; this.systemListBox.BorderStyle = BorderStyle.FixedSingle; this.systemListBox.IntegralHeight = false; this.systemListBox.Sorted = false; this.systemListBox.Dock = DockStyle.Fill; this.systemListBox.Click += new EventHandler(OnListClick); this.systemListBox.DrawItem += new DrawItemEventHandler(OnListDrawItem); this.systemListBox.KeyDown += new KeyEventHandler(OnListKeyDown); this.systemListBox.FontChanged += new EventHandler(OnFontChanged); this.systemListBox.KeyPress += new KeyPressEventHandler(this.editor.OnKeyPress); // for some reason Array.Sort craps out with the WebColorComparer, // so the WebColors property returns an array that is already sorted //Array.Sort(this.WebColors, new ColorCellEditor.ColorPicker.WebColorComparer()); for (int i=0; i<this.WebColors.Length; i++) { this.webListBox.Items.Add(this.WebColors[i]); } Array.Sort(this.SystemColors, new ColorCellEditor.ColorPicker.SystemColorComparer()); for (int i=0; i<this.SystemColors.Length; i++) { this.systemListBox.Items.Add(this.SystemColors[i]); } // // ColorPicker // this.Controls.Add(this.tabControl); this.Name = "ColorPicker"; this.Size = this.DefaultSize; this.tabControl.ResumeLayout(false); this.ResumeLayout(false); this.AdjustListBoxItemHeight(); }
/// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { this.m_tabControl = new System.Windows.Forms.TabControl(); this.m_colorTabPage = new System.Windows.Forms.TabPage(); this.m_knownColorsTabPage = new System.Windows.Forms.TabPage(); this.m_colorList = new ColorPicker.ColorListBox(); this.m_cancel = new System.Windows.Forms.Button(); this.m_ok = new System.Windows.Forms.Button(); this.m_tabControl.SuspendLayout(); this.m_knownColorsTabPage.SuspendLayout(); this.SuspendLayout(); // // m_tabControl // this.m_tabControl.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.m_tabControl.Controls.Add(this.m_colorTabPage); this.m_tabControl.Controls.Add(this.m_knownColorsTabPage); this.m_tabControl.Location = new System.Drawing.Point(4, 5); this.m_tabControl.Name = "m_tabControl"; this.m_tabControl.SelectedIndex = 0; this.m_tabControl.Size = new System.Drawing.Size(527, 282); this.m_tabControl.TabIndex = 1; this.m_tabControl.Selected += new System.Windows.Forms.TabControlEventHandler(this.OnSelected); // // m_colorTabPage // this.m_colorTabPage.Location = new System.Drawing.Point(4, 22); this.m_colorTabPage.Name = "m_colorTabPage"; this.m_colorTabPage.Padding = new System.Windows.Forms.Padding(3); this.m_colorTabPage.Size = new System.Drawing.Size(519, 256); this.m_colorTabPage.TabIndex = 0; this.m_colorTabPage.Text = "Colors"; this.m_colorTabPage.UseVisualStyleBackColor = true; // // m_knownColorsTabPage // this.m_knownColorsTabPage.Controls.Add(this.m_colorList); this.m_knownColorsTabPage.Location = new System.Drawing.Point(4, 22); this.m_knownColorsTabPage.Name = "m_knownColorsTabPage"; this.m_knownColorsTabPage.Padding = new System.Windows.Forms.Padding(3); this.m_knownColorsTabPage.Size = new System.Drawing.Size(519, 256); this.m_knownColorsTabPage.TabIndex = 1; this.m_knownColorsTabPage.Text = "Known Colors"; this.m_knownColorsTabPage.UseVisualStyleBackColor = true; // // m_colorList // this.m_colorList.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.m_colorList.ColumnWidth = 170; this.m_colorList.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed; this.m_colorList.FormattingEnabled = true; this.m_colorList.ItemHeight = 26; this.m_colorList.Items.AddRange(new object[] { System.Drawing.Color.AliceBlue, System.Drawing.Color.AntiqueWhite, System.Drawing.Color.Aqua, System.Drawing.Color.Aquamarine, System.Drawing.Color.Azure, System.Drawing.Color.Beige, System.Drawing.Color.Bisque, System.Drawing.Color.Black, System.Drawing.Color.BlanchedAlmond, System.Drawing.Color.Blue, System.Drawing.Color.BlueViolet, System.Drawing.Color.Brown, System.Drawing.Color.BurlyWood, System.Drawing.Color.CadetBlue, System.Drawing.Color.Chartreuse, System.Drawing.Color.Chocolate, System.Drawing.Color.Coral, System.Drawing.Color.CornflowerBlue, System.Drawing.Color.Cornsilk, System.Drawing.Color.Crimson, System.Drawing.Color.Cyan, System.Drawing.Color.DarkBlue, System.Drawing.Color.DarkCyan, System.Drawing.Color.DarkGoldenrod, System.Drawing.Color.DarkGray, System.Drawing.Color.DarkGreen, System.Drawing.Color.DarkKhaki, System.Drawing.Color.DarkMagenta, System.Drawing.Color.DarkOliveGreen, System.Drawing.Color.DarkOrange, System.Drawing.Color.DarkOrchid, System.Drawing.Color.DarkRed, System.Drawing.Color.DarkSalmon, System.Drawing.Color.DarkSeaGreen, System.Drawing.Color.DarkSlateBlue, System.Drawing.Color.DarkSlateGray, System.Drawing.Color.DarkTurquoise, System.Drawing.Color.DarkViolet, System.Drawing.Color.DeepPink, System.Drawing.Color.DeepSkyBlue, System.Drawing.Color.DimGray, System.Drawing.Color.DodgerBlue, System.Drawing.Color.Firebrick, System.Drawing.Color.FloralWhite, System.Drawing.Color.ForestGreen, System.Drawing.Color.Fuchsia, System.Drawing.Color.Gainsboro, System.Drawing.Color.GhostWhite, System.Drawing.Color.Gold, System.Drawing.Color.Goldenrod, System.Drawing.Color.Gray, System.Drawing.Color.Green, System.Drawing.Color.GreenYellow, System.Drawing.Color.Honeydew, System.Drawing.Color.HotPink, System.Drawing.Color.IndianRed, System.Drawing.Color.Indigo, System.Drawing.Color.Ivory, System.Drawing.Color.Khaki, System.Drawing.Color.Lavender, System.Drawing.Color.LavenderBlush, System.Drawing.Color.LawnGreen, System.Drawing.Color.LemonChiffon, System.Drawing.Color.LightBlue, System.Drawing.Color.LightCoral, System.Drawing.Color.LightCyan, System.Drawing.Color.LightGoldenrodYellow, System.Drawing.Color.LightGreen, System.Drawing.Color.LightGray, System.Drawing.Color.LightPink, System.Drawing.Color.LightSalmon, System.Drawing.Color.LightSeaGreen, System.Drawing.Color.LightSkyBlue, System.Drawing.Color.LightSlateGray, System.Drawing.Color.LightSteelBlue, System.Drawing.Color.LightYellow, System.Drawing.Color.Lime, System.Drawing.Color.LimeGreen, System.Drawing.Color.Linen, System.Drawing.Color.Magenta, System.Drawing.Color.Maroon, System.Drawing.Color.MediumAquamarine, System.Drawing.Color.MediumBlue, System.Drawing.Color.MediumOrchid, System.Drawing.Color.MediumPurple, System.Drawing.Color.MediumSeaGreen, System.Drawing.Color.MediumSlateBlue, System.Drawing.Color.MediumSpringGreen, System.Drawing.Color.MediumTurquoise, System.Drawing.Color.MediumVioletRed, System.Drawing.Color.MidnightBlue, System.Drawing.Color.MintCream, System.Drawing.Color.MistyRose, System.Drawing.Color.Moccasin, System.Drawing.Color.NavajoWhite, System.Drawing.Color.Navy, System.Drawing.Color.OldLace, System.Drawing.Color.Olive, System.Drawing.Color.OliveDrab, System.Drawing.Color.Orange, System.Drawing.Color.OrangeRed, System.Drawing.Color.Orchid, System.Drawing.Color.PaleGoldenrod, System.Drawing.Color.PaleGreen, System.Drawing.Color.PaleTurquoise, System.Drawing.Color.PaleVioletRed, System.Drawing.Color.PapayaWhip, System.Drawing.Color.PeachPuff, System.Drawing.Color.Peru, System.Drawing.Color.Pink, System.Drawing.Color.Plum, System.Drawing.Color.PowderBlue, System.Drawing.Color.Purple, System.Drawing.Color.Red, System.Drawing.Color.RosyBrown, System.Drawing.Color.RoyalBlue, System.Drawing.Color.SaddleBrown, System.Drawing.Color.Salmon, System.Drawing.Color.SandyBrown, System.Drawing.Color.SeaGreen, System.Drawing.Color.SeaShell, System.Drawing.Color.Sienna, System.Drawing.Color.Silver, System.Drawing.Color.SkyBlue, System.Drawing.Color.SlateBlue, System.Drawing.Color.SlateGray, System.Drawing.Color.Snow, System.Drawing.Color.SpringGreen, System.Drawing.Color.SteelBlue, System.Drawing.Color.Tan, System.Drawing.Color.Teal, System.Drawing.Color.Thistle, System.Drawing.Color.Tomato, System.Drawing.Color.Turquoise, System.Drawing.Color.Violet, System.Drawing.Color.Wheat, System.Drawing.Color.White, System.Drawing.Color.WhiteSmoke, System.Drawing.Color.Yellow, System.Drawing.Color.YellowGreen, System.Drawing.Color.AliceBlue, System.Drawing.Color.AntiqueWhite, System.Drawing.Color.Aqua, System.Drawing.Color.Aquamarine, System.Drawing.Color.Azure, System.Drawing.Color.Beige, System.Drawing.Color.Bisque, System.Drawing.Color.Black, System.Drawing.Color.BlanchedAlmond, System.Drawing.Color.Blue, System.Drawing.Color.BlueViolet, System.Drawing.Color.Brown, System.Drawing.Color.BurlyWood, System.Drawing.Color.CadetBlue, System.Drawing.Color.Chartreuse, System.Drawing.Color.Chocolate, System.Drawing.Color.Coral, System.Drawing.Color.CornflowerBlue, System.Drawing.Color.Cornsilk, System.Drawing.Color.Crimson, System.Drawing.Color.Cyan, System.Drawing.Color.DarkBlue, System.Drawing.Color.DarkCyan, System.Drawing.Color.DarkGoldenrod, System.Drawing.Color.DarkGray, System.Drawing.Color.DarkGreen, System.Drawing.Color.DarkKhaki, System.Drawing.Color.DarkMagenta, System.Drawing.Color.DarkOliveGreen, System.Drawing.Color.DarkOrange, System.Drawing.Color.DarkOrchid, System.Drawing.Color.DarkRed, System.Drawing.Color.DarkSalmon, System.Drawing.Color.DarkSeaGreen, System.Drawing.Color.DarkSlateBlue, System.Drawing.Color.DarkSlateGray, System.Drawing.Color.DarkTurquoise, System.Drawing.Color.DarkViolet, System.Drawing.Color.DeepPink, System.Drawing.Color.DeepSkyBlue, System.Drawing.Color.DimGray, System.Drawing.Color.DodgerBlue, System.Drawing.Color.Firebrick, System.Drawing.Color.FloralWhite, System.Drawing.Color.ForestGreen, System.Drawing.Color.Fuchsia, System.Drawing.Color.Gainsboro, System.Drawing.Color.GhostWhite, System.Drawing.Color.Gold, System.Drawing.Color.Goldenrod, System.Drawing.Color.Gray, System.Drawing.Color.Green, System.Drawing.Color.GreenYellow, System.Drawing.Color.Honeydew, System.Drawing.Color.HotPink, System.Drawing.Color.IndianRed, System.Drawing.Color.Indigo, System.Drawing.Color.Ivory, System.Drawing.Color.Khaki, System.Drawing.Color.Lavender, System.Drawing.Color.LavenderBlush, System.Drawing.Color.LawnGreen, System.Drawing.Color.LemonChiffon, System.Drawing.Color.LightBlue, System.Drawing.Color.LightCoral, System.Drawing.Color.LightCyan, System.Drawing.Color.LightGoldenrodYellow, System.Drawing.Color.LightGreen, System.Drawing.Color.LightGray, System.Drawing.Color.LightPink, System.Drawing.Color.LightSalmon, System.Drawing.Color.LightSeaGreen, System.Drawing.Color.LightSkyBlue, System.Drawing.Color.LightSlateGray, System.Drawing.Color.LightSteelBlue, System.Drawing.Color.LightYellow, System.Drawing.Color.Lime, System.Drawing.Color.LimeGreen, System.Drawing.Color.Linen, System.Drawing.Color.Magenta, System.Drawing.Color.Maroon, System.Drawing.Color.MediumAquamarine, System.Drawing.Color.MediumBlue, System.Drawing.Color.MediumOrchid, System.Drawing.Color.MediumPurple, System.Drawing.Color.MediumSeaGreen, System.Drawing.Color.MediumSlateBlue, System.Drawing.Color.MediumSpringGreen, System.Drawing.Color.MediumTurquoise, System.Drawing.Color.MediumVioletRed, System.Drawing.Color.MidnightBlue, System.Drawing.Color.MintCream, System.Drawing.Color.MistyRose, System.Drawing.Color.Moccasin, System.Drawing.Color.NavajoWhite, System.Drawing.Color.Navy, System.Drawing.Color.OldLace, System.Drawing.Color.Olive, System.Drawing.Color.OliveDrab, System.Drawing.Color.Orange, System.Drawing.Color.OrangeRed, System.Drawing.Color.Orchid, System.Drawing.Color.PaleGoldenrod, System.Drawing.Color.PaleGreen, System.Drawing.Color.PaleTurquoise, System.Drawing.Color.PaleVioletRed, System.Drawing.Color.PapayaWhip, System.Drawing.Color.PeachPuff, System.Drawing.Color.Peru, System.Drawing.Color.Pink, System.Drawing.Color.Plum, System.Drawing.Color.PowderBlue, System.Drawing.Color.Purple, System.Drawing.Color.Red, System.Drawing.Color.RosyBrown, System.Drawing.Color.RoyalBlue, System.Drawing.Color.SaddleBrown, System.Drawing.Color.Salmon, System.Drawing.Color.SandyBrown, System.Drawing.Color.SeaGreen, System.Drawing.Color.SeaShell, System.Drawing.Color.Sienna, System.Drawing.Color.Silver, System.Drawing.Color.SkyBlue, System.Drawing.Color.SlateBlue, System.Drawing.Color.SlateGray, System.Drawing.Color.Snow, System.Drawing.Color.SpringGreen, System.Drawing.Color.SteelBlue, System.Drawing.Color.Tan, System.Drawing.Color.Teal, System.Drawing.Color.Thistle, System.Drawing.Color.Tomato, System.Drawing.Color.Turquoise, System.Drawing.Color.Violet, System.Drawing.Color.Wheat, System.Drawing.Color.White, System.Drawing.Color.WhiteSmoke, System.Drawing.Color.Yellow, System.Drawing.Color.YellowGreen, System.Drawing.Color.AliceBlue, System.Drawing.Color.AntiqueWhite, System.Drawing.Color.Aqua, System.Drawing.Color.Aquamarine, System.Drawing.Color.Azure, System.Drawing.Color.Beige, System.Drawing.Color.Bisque, System.Drawing.Color.Black, System.Drawing.Color.BlanchedAlmond, System.Drawing.Color.Blue, System.Drawing.Color.BlueViolet, System.Drawing.Color.Brown, System.Drawing.Color.BurlyWood, System.Drawing.Color.CadetBlue, System.Drawing.Color.Chartreuse, System.Drawing.Color.Chocolate, System.Drawing.Color.Coral, System.Drawing.Color.CornflowerBlue, System.Drawing.Color.Cornsilk, System.Drawing.Color.Crimson, System.Drawing.Color.Cyan, System.Drawing.Color.DarkBlue, System.Drawing.Color.DarkCyan, System.Drawing.Color.DarkGoldenrod, System.Drawing.Color.DarkGray, System.Drawing.Color.DarkGreen, System.Drawing.Color.DarkKhaki, System.Drawing.Color.DarkMagenta, System.Drawing.Color.DarkOliveGreen, System.Drawing.Color.DarkOrange, System.Drawing.Color.DarkOrchid, System.Drawing.Color.DarkRed, System.Drawing.Color.DarkSalmon, System.Drawing.Color.DarkSeaGreen, System.Drawing.Color.DarkSlateBlue, System.Drawing.Color.DarkSlateGray, System.Drawing.Color.DarkTurquoise, System.Drawing.Color.DarkViolet, System.Drawing.Color.DeepPink, System.Drawing.Color.DeepSkyBlue, System.Drawing.Color.DimGray, System.Drawing.Color.DodgerBlue, System.Drawing.Color.Firebrick, System.Drawing.Color.FloralWhite, System.Drawing.Color.ForestGreen, System.Drawing.Color.Fuchsia, System.Drawing.Color.Gainsboro, System.Drawing.Color.GhostWhite, System.Drawing.Color.Gold, System.Drawing.Color.Goldenrod, System.Drawing.Color.Gray, System.Drawing.Color.Green, System.Drawing.Color.GreenYellow, System.Drawing.Color.Honeydew, System.Drawing.Color.HotPink, System.Drawing.Color.IndianRed, System.Drawing.Color.Indigo, System.Drawing.Color.Ivory, System.Drawing.Color.Khaki, System.Drawing.Color.Lavender, System.Drawing.Color.LavenderBlush, System.Drawing.Color.LawnGreen, System.Drawing.Color.LemonChiffon, System.Drawing.Color.LightBlue, System.Drawing.Color.LightCoral, System.Drawing.Color.LightCyan, System.Drawing.Color.LightGoldenrodYellow, System.Drawing.Color.LightGreen, System.Drawing.Color.LightGray, System.Drawing.Color.LightPink, System.Drawing.Color.LightSalmon, System.Drawing.Color.LightSeaGreen, System.Drawing.Color.LightSkyBlue, System.Drawing.Color.LightSlateGray, System.Drawing.Color.LightSteelBlue, System.Drawing.Color.LightYellow, System.Drawing.Color.Lime, System.Drawing.Color.LimeGreen, System.Drawing.Color.Linen, System.Drawing.Color.Magenta, System.Drawing.Color.Maroon, System.Drawing.Color.MediumAquamarine, System.Drawing.Color.MediumBlue, System.Drawing.Color.MediumOrchid, System.Drawing.Color.MediumPurple, System.Drawing.Color.MediumSeaGreen, System.Drawing.Color.MediumSlateBlue, System.Drawing.Color.MediumSpringGreen, System.Drawing.Color.MediumTurquoise, System.Drawing.Color.MediumVioletRed, System.Drawing.Color.MidnightBlue, System.Drawing.Color.MintCream, System.Drawing.Color.MistyRose, System.Drawing.Color.Moccasin, System.Drawing.Color.NavajoWhite, System.Drawing.Color.Navy, System.Drawing.Color.OldLace, System.Drawing.Color.Olive, System.Drawing.Color.OliveDrab, System.Drawing.Color.Orange, System.Drawing.Color.OrangeRed, System.Drawing.Color.Orchid, System.Drawing.Color.PaleGoldenrod, System.Drawing.Color.PaleGreen, System.Drawing.Color.PaleTurquoise, System.Drawing.Color.PaleVioletRed, System.Drawing.Color.PapayaWhip, System.Drawing.Color.PeachPuff, System.Drawing.Color.Peru, System.Drawing.Color.Pink, System.Drawing.Color.Plum, System.Drawing.Color.PowderBlue, System.Drawing.Color.Purple, System.Drawing.Color.Red, System.Drawing.Color.RosyBrown, System.Drawing.Color.RoyalBlue, System.Drawing.Color.SaddleBrown, System.Drawing.Color.Salmon, System.Drawing.Color.SandyBrown, System.Drawing.Color.SeaGreen, System.Drawing.Color.SeaShell, System.Drawing.Color.Sienna, System.Drawing.Color.Silver, System.Drawing.Color.SkyBlue, System.Drawing.Color.SlateBlue, System.Drawing.Color.SlateGray, System.Drawing.Color.Snow, System.Drawing.Color.SpringGreen, System.Drawing.Color.SteelBlue, System.Drawing.Color.Tan, System.Drawing.Color.Teal, System.Drawing.Color.Thistle, System.Drawing.Color.Tomato, System.Drawing.Color.Turquoise, System.Drawing.Color.Violet, System.Drawing.Color.Wheat, System.Drawing.Color.White, System.Drawing.Color.WhiteSmoke, System.Drawing.Color.Yellow, System.Drawing.Color.YellowGreen, System.Drawing.Color.AliceBlue, System.Drawing.Color.AntiqueWhite, System.Drawing.Color.Aqua, System.Drawing.Color.Aquamarine, System.Drawing.Color.Azure, System.Drawing.Color.Beige, System.Drawing.Color.Bisque, System.Drawing.Color.Black, System.Drawing.Color.BlanchedAlmond, System.Drawing.Color.Blue, System.Drawing.Color.BlueViolet, System.Drawing.Color.Brown, System.Drawing.Color.BurlyWood, System.Drawing.Color.CadetBlue, System.Drawing.Color.Chartreuse, System.Drawing.Color.Chocolate, System.Drawing.Color.Coral, System.Drawing.Color.CornflowerBlue, System.Drawing.Color.Cornsilk, System.Drawing.Color.Crimson, System.Drawing.Color.Cyan, System.Drawing.Color.DarkBlue, System.Drawing.Color.DarkCyan, System.Drawing.Color.DarkGoldenrod, System.Drawing.Color.DarkGray, System.Drawing.Color.DarkGreen, System.Drawing.Color.DarkKhaki, System.Drawing.Color.DarkMagenta, System.Drawing.Color.DarkOliveGreen, System.Drawing.Color.DarkOrange, System.Drawing.Color.DarkOrchid, System.Drawing.Color.DarkRed, System.Drawing.Color.DarkSalmon, System.Drawing.Color.DarkSeaGreen, System.Drawing.Color.DarkSlateBlue, System.Drawing.Color.DarkSlateGray, System.Drawing.Color.DarkTurquoise, System.Drawing.Color.DarkViolet, System.Drawing.Color.DeepPink, System.Drawing.Color.DeepSkyBlue, System.Drawing.Color.DimGray, System.Drawing.Color.DodgerBlue, System.Drawing.Color.Firebrick, System.Drawing.Color.FloralWhite, System.Drawing.Color.ForestGreen, System.Drawing.Color.Fuchsia, System.Drawing.Color.Gainsboro, System.Drawing.Color.GhostWhite, System.Drawing.Color.Gold, System.Drawing.Color.Goldenrod, System.Drawing.Color.Gray, System.Drawing.Color.Green, System.Drawing.Color.GreenYellow, System.Drawing.Color.Honeydew, System.Drawing.Color.HotPink, System.Drawing.Color.IndianRed, System.Drawing.Color.Indigo, System.Drawing.Color.Ivory, System.Drawing.Color.Khaki, System.Drawing.Color.Lavender, System.Drawing.Color.LavenderBlush, System.Drawing.Color.LawnGreen, System.Drawing.Color.LemonChiffon, System.Drawing.Color.LightBlue, System.Drawing.Color.LightCoral, System.Drawing.Color.LightCyan, System.Drawing.Color.LightGoldenrodYellow, System.Drawing.Color.LightGreen, System.Drawing.Color.LightGray, System.Drawing.Color.LightPink, System.Drawing.Color.LightSalmon, System.Drawing.Color.LightSeaGreen, System.Drawing.Color.LightSkyBlue, System.Drawing.Color.LightSlateGray, System.Drawing.Color.LightSteelBlue, System.Drawing.Color.LightYellow, System.Drawing.Color.Lime, System.Drawing.Color.LimeGreen, System.Drawing.Color.Linen, System.Drawing.Color.Magenta, System.Drawing.Color.Maroon, System.Drawing.Color.MediumAquamarine, System.Drawing.Color.MediumBlue, System.Drawing.Color.MediumOrchid, System.Drawing.Color.MediumPurple, System.Drawing.Color.MediumSeaGreen, System.Drawing.Color.MediumSlateBlue, System.Drawing.Color.MediumSpringGreen, System.Drawing.Color.MediumTurquoise, System.Drawing.Color.MediumVioletRed, System.Drawing.Color.MidnightBlue, System.Drawing.Color.MintCream, System.Drawing.Color.MistyRose, System.Drawing.Color.Moccasin, System.Drawing.Color.NavajoWhite, System.Drawing.Color.Navy, System.Drawing.Color.OldLace, System.Drawing.Color.Olive, System.Drawing.Color.OliveDrab, System.Drawing.Color.Orange, System.Drawing.Color.OrangeRed, System.Drawing.Color.Orchid, System.Drawing.Color.PaleGoldenrod, System.Drawing.Color.PaleGreen, System.Drawing.Color.PaleTurquoise, System.Drawing.Color.PaleVioletRed, System.Drawing.Color.PapayaWhip, System.Drawing.Color.PeachPuff, System.Drawing.Color.Peru, System.Drawing.Color.Pink, System.Drawing.Color.Plum, System.Drawing.Color.PowderBlue, System.Drawing.Color.Purple, System.Drawing.Color.Red, System.Drawing.Color.RosyBrown, System.Drawing.Color.RoyalBlue, System.Drawing.Color.SaddleBrown, System.Drawing.Color.Salmon, System.Drawing.Color.SandyBrown, System.Drawing.Color.SeaGreen, System.Drawing.Color.SeaShell, System.Drawing.Color.Sienna, System.Drawing.Color.Silver, System.Drawing.Color.SkyBlue, System.Drawing.Color.SlateBlue, System.Drawing.Color.SlateGray, System.Drawing.Color.Snow, System.Drawing.Color.SpringGreen, System.Drawing.Color.SteelBlue, System.Drawing.Color.Tan, System.Drawing.Color.Teal, System.Drawing.Color.Thistle, System.Drawing.Color.Tomato, System.Drawing.Color.Turquoise, System.Drawing.Color.Violet, System.Drawing.Color.Wheat, System.Drawing.Color.White, System.Drawing.Color.WhiteSmoke, System.Drawing.Color.Yellow, System.Drawing.Color.YellowGreen, System.Drawing.Color.AliceBlue, System.Drawing.Color.AntiqueWhite, System.Drawing.Color.Aqua, System.Drawing.Color.Aquamarine, System.Drawing.Color.Azure, System.Drawing.Color.Beige, System.Drawing.Color.Bisque, System.Drawing.Color.Black, System.Drawing.Color.BlanchedAlmond, System.Drawing.Color.Blue, System.Drawing.Color.BlueViolet, System.Drawing.Color.Brown, System.Drawing.Color.BurlyWood, System.Drawing.Color.CadetBlue, System.Drawing.Color.Chartreuse, System.Drawing.Color.Chocolate, System.Drawing.Color.Coral, System.Drawing.Color.CornflowerBlue, System.Drawing.Color.Cornsilk, System.Drawing.Color.Crimson, System.Drawing.Color.Cyan, System.Drawing.Color.DarkBlue, System.Drawing.Color.DarkCyan, System.Drawing.Color.DarkGoldenrod, System.Drawing.Color.DarkGray, System.Drawing.Color.DarkGreen, System.Drawing.Color.DarkKhaki, System.Drawing.Color.DarkMagenta, System.Drawing.Color.DarkOliveGreen, System.Drawing.Color.DarkOrange, System.Drawing.Color.DarkOrchid, System.Drawing.Color.DarkRed, System.Drawing.Color.DarkSalmon, System.Drawing.Color.DarkSeaGreen, System.Drawing.Color.DarkSlateBlue, System.Drawing.Color.DarkSlateGray, System.Drawing.Color.DarkTurquoise, System.Drawing.Color.DarkViolet, System.Drawing.Color.DeepPink, System.Drawing.Color.DeepSkyBlue, System.Drawing.Color.DimGray, System.Drawing.Color.DodgerBlue, System.Drawing.Color.Firebrick, System.Drawing.Color.FloralWhite, System.Drawing.Color.ForestGreen, System.Drawing.Color.Fuchsia, System.Drawing.Color.Gainsboro, System.Drawing.Color.GhostWhite, System.Drawing.Color.Gold, System.Drawing.Color.Goldenrod, System.Drawing.Color.Gray, System.Drawing.Color.Green, System.Drawing.Color.GreenYellow, System.Drawing.Color.Honeydew, System.Drawing.Color.HotPink, System.Drawing.Color.IndianRed, System.Drawing.Color.Indigo, System.Drawing.Color.Ivory, System.Drawing.Color.Khaki, System.Drawing.Color.Lavender, System.Drawing.Color.LavenderBlush, System.Drawing.Color.LawnGreen, System.Drawing.Color.LemonChiffon, System.Drawing.Color.LightBlue, System.Drawing.Color.LightCoral, System.Drawing.Color.LightCyan, System.Drawing.Color.LightGoldenrodYellow, System.Drawing.Color.LightGreen, System.Drawing.Color.LightGray, System.Drawing.Color.LightPink, System.Drawing.Color.LightSalmon, System.Drawing.Color.LightSeaGreen, System.Drawing.Color.LightSkyBlue, System.Drawing.Color.LightSlateGray, System.Drawing.Color.LightSteelBlue, System.Drawing.Color.LightYellow, System.Drawing.Color.Lime, System.Drawing.Color.LimeGreen, System.Drawing.Color.Linen, System.Drawing.Color.Magenta, System.Drawing.Color.Maroon, System.Drawing.Color.MediumAquamarine, System.Drawing.Color.MediumBlue, System.Drawing.Color.MediumOrchid, System.Drawing.Color.MediumPurple, System.Drawing.Color.MediumSeaGreen, System.Drawing.Color.MediumSlateBlue, System.Drawing.Color.MediumSpringGreen, System.Drawing.Color.MediumTurquoise, System.Drawing.Color.MediumVioletRed, System.Drawing.Color.MidnightBlue, System.Drawing.Color.MintCream, System.Drawing.Color.MistyRose, System.Drawing.Color.Moccasin, System.Drawing.Color.NavajoWhite, System.Drawing.Color.Navy, System.Drawing.Color.OldLace, System.Drawing.Color.Olive, System.Drawing.Color.OliveDrab, System.Drawing.Color.Orange, System.Drawing.Color.OrangeRed, System.Drawing.Color.Orchid, System.Drawing.Color.PaleGoldenrod, System.Drawing.Color.PaleGreen, System.Drawing.Color.PaleTurquoise, System.Drawing.Color.PaleVioletRed, System.Drawing.Color.PapayaWhip, System.Drawing.Color.PeachPuff, System.Drawing.Color.Peru, System.Drawing.Color.Pink, System.Drawing.Color.Plum, System.Drawing.Color.PowderBlue, System.Drawing.Color.Purple, System.Drawing.Color.Red, System.Drawing.Color.RosyBrown, System.Drawing.Color.RoyalBlue, System.Drawing.Color.SaddleBrown, System.Drawing.Color.Salmon, System.Drawing.Color.SandyBrown, System.Drawing.Color.SeaGreen, System.Drawing.Color.SeaShell, System.Drawing.Color.Sienna, System.Drawing.Color.Silver, System.Drawing.Color.SkyBlue, System.Drawing.Color.SlateBlue, System.Drawing.Color.SlateGray, System.Drawing.Color.Snow, System.Drawing.Color.SpringGreen, System.Drawing.Color.SteelBlue, System.Drawing.Color.Tan, System.Drawing.Color.Teal, System.Drawing.Color.Thistle, System.Drawing.Color.Tomato, System.Drawing.Color.Turquoise, System.Drawing.Color.Violet, System.Drawing.Color.Wheat, System.Drawing.Color.White, System.Drawing.Color.WhiteSmoke, System.Drawing.Color.Yellow, System.Drawing.Color.YellowGreen, System.Drawing.Color.AliceBlue, System.Drawing.Color.AntiqueWhite, System.Drawing.Color.Aqua, System.Drawing.Color.Aquamarine, System.Drawing.Color.Azure, System.Drawing.Color.Beige, System.Drawing.Color.Bisque, System.Drawing.Color.Black, System.Drawing.Color.BlanchedAlmond, System.Drawing.Color.Blue, System.Drawing.Color.BlueViolet, System.Drawing.Color.Brown, System.Drawing.Color.BurlyWood, System.Drawing.Color.CadetBlue, System.Drawing.Color.Chartreuse, System.Drawing.Color.Chocolate, System.Drawing.Color.Coral, System.Drawing.Color.CornflowerBlue, System.Drawing.Color.Cornsilk, System.Drawing.Color.Crimson, System.Drawing.Color.Cyan, System.Drawing.Color.DarkBlue, System.Drawing.Color.DarkCyan, System.Drawing.Color.DarkGoldenrod, System.Drawing.Color.DarkGray, System.Drawing.Color.DarkGreen, System.Drawing.Color.DarkKhaki, System.Drawing.Color.DarkMagenta, System.Drawing.Color.DarkOliveGreen, System.Drawing.Color.DarkOrange, System.Drawing.Color.DarkOrchid, System.Drawing.Color.DarkRed, System.Drawing.Color.DarkSalmon, System.Drawing.Color.DarkSeaGreen, System.Drawing.Color.DarkSlateBlue, System.Drawing.Color.DarkSlateGray, System.Drawing.Color.DarkTurquoise, System.Drawing.Color.DarkViolet, System.Drawing.Color.DeepPink, System.Drawing.Color.DeepSkyBlue, System.Drawing.Color.DimGray, System.Drawing.Color.DodgerBlue, System.Drawing.Color.Firebrick, System.Drawing.Color.FloralWhite, System.Drawing.Color.ForestGreen, System.Drawing.Color.Fuchsia, System.Drawing.Color.Gainsboro, System.Drawing.Color.GhostWhite, System.Drawing.Color.Gold, System.Drawing.Color.Goldenrod, System.Drawing.Color.Gray, System.Drawing.Color.Green, System.Drawing.Color.GreenYellow, System.Drawing.Color.Honeydew, System.Drawing.Color.HotPink, System.Drawing.Color.IndianRed, System.Drawing.Color.Indigo, System.Drawing.Color.Ivory, System.Drawing.Color.Khaki, System.Drawing.Color.Lavender, System.Drawing.Color.LavenderBlush, System.Drawing.Color.LawnGreen, System.Drawing.Color.LemonChiffon, System.Drawing.Color.LightBlue, System.Drawing.Color.LightCoral, System.Drawing.Color.LightCyan, System.Drawing.Color.LightGoldenrodYellow, System.Drawing.Color.LightGreen, System.Drawing.Color.LightGray, System.Drawing.Color.LightPink, System.Drawing.Color.LightSalmon, System.Drawing.Color.LightSeaGreen, System.Drawing.Color.LightSkyBlue, System.Drawing.Color.LightSlateGray, System.Drawing.Color.LightSteelBlue, System.Drawing.Color.LightYellow, System.Drawing.Color.Lime, System.Drawing.Color.LimeGreen, System.Drawing.Color.Linen, System.Drawing.Color.Magenta, System.Drawing.Color.Maroon, System.Drawing.Color.MediumAquamarine, System.Drawing.Color.MediumBlue, System.Drawing.Color.MediumOrchid, System.Drawing.Color.MediumPurple, System.Drawing.Color.MediumSeaGreen, System.Drawing.Color.MediumSlateBlue, System.Drawing.Color.MediumSpringGreen, System.Drawing.Color.MediumTurquoise, System.Drawing.Color.MediumVioletRed, System.Drawing.Color.MidnightBlue, System.Drawing.Color.MintCream, System.Drawing.Color.MistyRose, System.Drawing.Color.Moccasin, System.Drawing.Color.NavajoWhite, System.Drawing.Color.Navy, System.Drawing.Color.OldLace, System.Drawing.Color.Olive, System.Drawing.Color.OliveDrab, System.Drawing.Color.Orange, System.Drawing.Color.OrangeRed, System.Drawing.Color.Orchid, System.Drawing.Color.PaleGoldenrod, System.Drawing.Color.PaleGreen, System.Drawing.Color.PaleTurquoise, System.Drawing.Color.PaleVioletRed, System.Drawing.Color.PapayaWhip, System.Drawing.Color.PeachPuff, System.Drawing.Color.Peru, System.Drawing.Color.Pink, System.Drawing.Color.Plum, System.Drawing.Color.PowderBlue, System.Drawing.Color.Purple, System.Drawing.Color.Red, System.Drawing.Color.RosyBrown, System.Drawing.Color.RoyalBlue, System.Drawing.Color.SaddleBrown, System.Drawing.Color.Salmon, System.Drawing.Color.SandyBrown, System.Drawing.Color.SeaGreen, System.Drawing.Color.SeaShell, System.Drawing.Color.Sienna, System.Drawing.Color.Silver, System.Drawing.Color.SkyBlue, System.Drawing.Color.SlateBlue, System.Drawing.Color.SlateGray, System.Drawing.Color.Snow, System.Drawing.Color.SpringGreen, System.Drawing.Color.SteelBlue, System.Drawing.Color.Tan, System.Drawing.Color.Teal, System.Drawing.Color.Thistle, System.Drawing.Color.Tomato, System.Drawing.Color.Turquoise, System.Drawing.Color.Violet, System.Drawing.Color.Wheat, System.Drawing.Color.White, System.Drawing.Color.WhiteSmoke, System.Drawing.Color.Yellow, System.Drawing.Color.YellowGreen, System.Drawing.Color.AliceBlue, System.Drawing.Color.AntiqueWhite, System.Drawing.Color.Aqua, System.Drawing.Color.Aquamarine, System.Drawing.Color.Azure, System.Drawing.Color.Beige, System.Drawing.Color.Bisque, System.Drawing.Color.Black, System.Drawing.Color.BlanchedAlmond, System.Drawing.Color.Blue, System.Drawing.Color.BlueViolet, System.Drawing.Color.Brown, System.Drawing.Color.BurlyWood, System.Drawing.Color.CadetBlue, System.Drawing.Color.Chartreuse, System.Drawing.Color.Chocolate, System.Drawing.Color.Coral, System.Drawing.Color.CornflowerBlue, System.Drawing.Color.Cornsilk, System.Drawing.Color.Crimson, System.Drawing.Color.Cyan, System.Drawing.Color.DarkBlue, System.Drawing.Color.DarkCyan, System.Drawing.Color.DarkGoldenrod, System.Drawing.Color.DarkGray, System.Drawing.Color.DarkGreen, System.Drawing.Color.DarkKhaki, System.Drawing.Color.DarkMagenta, System.Drawing.Color.DarkOliveGreen, System.Drawing.Color.DarkOrange, System.Drawing.Color.DarkOrchid, System.Drawing.Color.DarkRed, System.Drawing.Color.DarkSalmon, System.Drawing.Color.DarkSeaGreen, System.Drawing.Color.DarkSlateBlue, System.Drawing.Color.DarkSlateGray, System.Drawing.Color.DarkTurquoise, System.Drawing.Color.DarkViolet, System.Drawing.Color.DeepPink, System.Drawing.Color.DeepSkyBlue, System.Drawing.Color.DimGray, System.Drawing.Color.DodgerBlue, System.Drawing.Color.Firebrick, System.Drawing.Color.FloralWhite, System.Drawing.Color.ForestGreen, System.Drawing.Color.Fuchsia, System.Drawing.Color.Gainsboro, System.Drawing.Color.GhostWhite, System.Drawing.Color.Gold, System.Drawing.Color.Goldenrod, System.Drawing.Color.Gray, System.Drawing.Color.Green, System.Drawing.Color.GreenYellow, System.Drawing.Color.Honeydew, System.Drawing.Color.HotPink, System.Drawing.Color.IndianRed, System.Drawing.Color.Indigo, System.Drawing.Color.Ivory, System.Drawing.Color.Khaki, System.Drawing.Color.Lavender, System.Drawing.Color.LavenderBlush, System.Drawing.Color.LawnGreen, System.Drawing.Color.LemonChiffon, System.Drawing.Color.LightBlue, System.Drawing.Color.LightCoral, System.Drawing.Color.LightCyan, System.Drawing.Color.LightGoldenrodYellow, System.Drawing.Color.LightGreen, System.Drawing.Color.LightGray, System.Drawing.Color.LightPink, System.Drawing.Color.LightSalmon, System.Drawing.Color.LightSeaGreen, System.Drawing.Color.LightSkyBlue, System.Drawing.Color.LightSlateGray, System.Drawing.Color.LightSteelBlue, System.Drawing.Color.LightYellow, System.Drawing.Color.Lime, System.Drawing.Color.LimeGreen, System.Drawing.Color.Linen, System.Drawing.Color.Magenta, System.Drawing.Color.Maroon, System.Drawing.Color.MediumAquamarine, System.Drawing.Color.MediumBlue, System.Drawing.Color.MediumOrchid, System.Drawing.Color.MediumPurple, System.Drawing.Color.MediumSeaGreen, System.Drawing.Color.MediumSlateBlue, System.Drawing.Color.MediumSpringGreen, System.Drawing.Color.MediumTurquoise, System.Drawing.Color.MediumVioletRed, System.Drawing.Color.MidnightBlue, System.Drawing.Color.MintCream, System.Drawing.Color.MistyRose, System.Drawing.Color.Moccasin, System.Drawing.Color.NavajoWhite, System.Drawing.Color.Navy, System.Drawing.Color.OldLace, System.Drawing.Color.Olive, System.Drawing.Color.OliveDrab, System.Drawing.Color.Orange, System.Drawing.Color.OrangeRed, System.Drawing.Color.Orchid, System.Drawing.Color.PaleGoldenrod, System.Drawing.Color.PaleGreen, System.Drawing.Color.PaleTurquoise, System.Drawing.Color.PaleVioletRed, System.Drawing.Color.PapayaWhip, System.Drawing.Color.PeachPuff, System.Drawing.Color.Peru, System.Drawing.Color.Pink, System.Drawing.Color.Plum, System.Drawing.Color.PowderBlue, System.Drawing.Color.Purple, System.Drawing.Color.Red, System.Drawing.Color.RosyBrown, System.Drawing.Color.RoyalBlue, System.Drawing.Color.SaddleBrown, System.Drawing.Color.Salmon, System.Drawing.Color.SandyBrown, System.Drawing.Color.SeaGreen, System.Drawing.Color.SeaShell, System.Drawing.Color.Sienna, System.Drawing.Color.Silver, System.Drawing.Color.SkyBlue, System.Drawing.Color.SlateBlue, System.Drawing.Color.SlateGray, System.Drawing.Color.Snow, System.Drawing.Color.SpringGreen, System.Drawing.Color.SteelBlue, System.Drawing.Color.Tan, System.Drawing.Color.Teal, System.Drawing.Color.Thistle, System.Drawing.Color.Tomato, System.Drawing.Color.Turquoise, System.Drawing.Color.Violet, System.Drawing.Color.Wheat, System.Drawing.Color.White, System.Drawing.Color.WhiteSmoke, System.Drawing.Color.Yellow, System.Drawing.Color.YellowGreen, System.Drawing.Color.AliceBlue, System.Drawing.Color.AntiqueWhite, System.Drawing.Color.Aqua, System.Drawing.Color.Aquamarine, System.Drawing.Color.Azure, System.Drawing.Color.Beige, System.Drawing.Color.Bisque, System.Drawing.Color.Black, System.Drawing.Color.BlanchedAlmond, System.Drawing.Color.Blue, System.Drawing.Color.BlueViolet, System.Drawing.Color.Brown, System.Drawing.Color.BurlyWood, System.Drawing.Color.CadetBlue, System.Drawing.Color.Chartreuse, System.Drawing.Color.Chocolate, System.Drawing.Color.Coral, System.Drawing.Color.CornflowerBlue, System.Drawing.Color.Cornsilk, System.Drawing.Color.Crimson, System.Drawing.Color.Cyan, System.Drawing.Color.DarkBlue, System.Drawing.Color.DarkCyan, System.Drawing.Color.DarkGoldenrod, System.Drawing.Color.DarkGray, System.Drawing.Color.DarkGreen, System.Drawing.Color.DarkKhaki, System.Drawing.Color.DarkMagenta, System.Drawing.Color.DarkOliveGreen, System.Drawing.Color.DarkOrange, System.Drawing.Color.DarkOrchid, System.Drawing.Color.DarkRed, System.Drawing.Color.DarkSalmon, System.Drawing.Color.DarkSeaGreen, System.Drawing.Color.DarkSlateBlue, System.Drawing.Color.DarkSlateGray, System.Drawing.Color.DarkTurquoise, System.Drawing.Color.DarkViolet, System.Drawing.Color.DeepPink, System.Drawing.Color.DeepSkyBlue, System.Drawing.Color.DimGray, System.Drawing.Color.DodgerBlue, System.Drawing.Color.Firebrick, System.Drawing.Color.FloralWhite, System.Drawing.Color.ForestGreen, System.Drawing.Color.Fuchsia, System.Drawing.Color.Gainsboro, System.Drawing.Color.GhostWhite, System.Drawing.Color.Gold, System.Drawing.Color.Goldenrod, System.Drawing.Color.Gray, System.Drawing.Color.Green, System.Drawing.Color.GreenYellow, System.Drawing.Color.Honeydew, System.Drawing.Color.HotPink, System.Drawing.Color.IndianRed, System.Drawing.Color.Indigo, System.Drawing.Color.Ivory, System.Drawing.Color.Khaki, System.Drawing.Color.Lavender, System.Drawing.Color.LavenderBlush, System.Drawing.Color.LawnGreen, System.Drawing.Color.LemonChiffon, System.Drawing.Color.LightBlue, System.Drawing.Color.LightCoral, System.Drawing.Color.LightCyan, System.Drawing.Color.LightGoldenrodYellow, System.Drawing.Color.LightGreen, System.Drawing.Color.LightGray, System.Drawing.Color.LightPink, System.Drawing.Color.LightSalmon, System.Drawing.Color.LightSeaGreen, System.Drawing.Color.LightSkyBlue, System.Drawing.Color.LightSlateGray, System.Drawing.Color.LightSteelBlue, System.Drawing.Color.LightYellow, System.Drawing.Color.Lime, System.Drawing.Color.LimeGreen, System.Drawing.Color.Linen, System.Drawing.Color.Magenta, System.Drawing.Color.Maroon, System.Drawing.Color.MediumAquamarine, System.Drawing.Color.MediumBlue, System.Drawing.Color.MediumOrchid, System.Drawing.Color.MediumPurple, System.Drawing.Color.MediumSeaGreen, System.Drawing.Color.MediumSlateBlue, System.Drawing.Color.MediumSpringGreen, System.Drawing.Color.MediumTurquoise, System.Drawing.Color.MediumVioletRed, System.Drawing.Color.MidnightBlue, System.Drawing.Color.MintCream, System.Drawing.Color.MistyRose, System.Drawing.Color.Moccasin, System.Drawing.Color.NavajoWhite, System.Drawing.Color.Navy, System.Drawing.Color.OldLace, System.Drawing.Color.Olive, System.Drawing.Color.OliveDrab, System.Drawing.Color.Orange, System.Drawing.Color.OrangeRed, System.Drawing.Color.Orchid, System.Drawing.Color.PaleGoldenrod, System.Drawing.Color.PaleGreen, System.Drawing.Color.PaleTurquoise, System.Drawing.Color.PaleVioletRed, System.Drawing.Color.PapayaWhip, System.Drawing.Color.PeachPuff, System.Drawing.Color.Peru, System.Drawing.Color.Pink, System.Drawing.Color.Plum, System.Drawing.Color.PowderBlue, System.Drawing.Color.Purple, System.Drawing.Color.Red, System.Drawing.Color.RosyBrown, System.Drawing.Color.RoyalBlue, System.Drawing.Color.SaddleBrown, System.Drawing.Color.Salmon, System.Drawing.Color.SandyBrown, System.Drawing.Color.SeaGreen, System.Drawing.Color.SeaShell, System.Drawing.Color.Sienna, System.Drawing.Color.Silver, System.Drawing.Color.SkyBlue, System.Drawing.Color.SlateBlue, System.Drawing.Color.SlateGray, System.Drawing.Color.Snow, System.Drawing.Color.SpringGreen, System.Drawing.Color.SteelBlue, System.Drawing.Color.Tan, System.Drawing.Color.Teal, System.Drawing.Color.Thistle, System.Drawing.Color.Tomato, System.Drawing.Color.Turquoise, System.Drawing.Color.Violet, System.Drawing.Color.Wheat, System.Drawing.Color.White, System.Drawing.Color.WhiteSmoke, System.Drawing.Color.Yellow, System.Drawing.Color.YellowGreen, System.Drawing.Color.AliceBlue, System.Drawing.Color.AntiqueWhite, System.Drawing.Color.Aqua, System.Drawing.Color.Aquamarine, System.Drawing.Color.Azure, System.Drawing.Color.Beige, System.Drawing.Color.Bisque, System.Drawing.Color.Black, System.Drawing.Color.BlanchedAlmond, System.Drawing.Color.Blue, System.Drawing.Color.BlueViolet, System.Drawing.Color.Brown, System.Drawing.Color.BurlyWood, System.Drawing.Color.CadetBlue, System.Drawing.Color.Chartreuse, System.Drawing.Color.Chocolate, System.Drawing.Color.Coral, System.Drawing.Color.CornflowerBlue, System.Drawing.Color.Cornsilk, System.Drawing.Color.Crimson, System.Drawing.Color.Cyan, System.Drawing.Color.DarkBlue, System.Drawing.Color.DarkCyan, System.Drawing.Color.DarkGoldenrod, System.Drawing.Color.DarkGray, System.Drawing.Color.DarkGreen, System.Drawing.Color.DarkKhaki, System.Drawing.Color.DarkMagenta, System.Drawing.Color.DarkOliveGreen, System.Drawing.Color.DarkOrange, System.Drawing.Color.DarkOrchid, System.Drawing.Color.DarkRed, System.Drawing.Color.DarkSalmon, System.Drawing.Color.DarkSeaGreen, System.Drawing.Color.DarkSlateBlue, System.Drawing.Color.DarkSlateGray, System.Drawing.Color.DarkTurquoise, System.Drawing.Color.DarkViolet, System.Drawing.Color.DeepPink, System.Drawing.Color.DeepSkyBlue, System.Drawing.Color.DimGray, System.Drawing.Color.DodgerBlue, System.Drawing.Color.Firebrick, System.Drawing.Color.FloralWhite, System.Drawing.Color.ForestGreen, System.Drawing.Color.Fuchsia, System.Drawing.Color.Gainsboro, System.Drawing.Color.GhostWhite, System.Drawing.Color.Gold, System.Drawing.Color.Goldenrod, System.Drawing.Color.Gray, System.Drawing.Color.Green, System.Drawing.Color.GreenYellow, System.Drawing.Color.Honeydew, System.Drawing.Color.HotPink, System.Drawing.Color.IndianRed, System.Drawing.Color.Indigo, System.Drawing.Color.Ivory, System.Drawing.Color.Khaki, System.Drawing.Color.Lavender, System.Drawing.Color.LavenderBlush, System.Drawing.Color.LawnGreen, System.Drawing.Color.LemonChiffon, System.Drawing.Color.LightBlue, System.Drawing.Color.LightCoral, System.Drawing.Color.LightCyan, System.Drawing.Color.LightGoldenrodYellow, System.Drawing.Color.LightGreen, System.Drawing.Color.LightGray, System.Drawing.Color.LightPink, System.Drawing.Color.LightSalmon, System.Drawing.Color.LightSeaGreen, System.Drawing.Color.LightSkyBlue, System.Drawing.Color.LightSlateGray, System.Drawing.Color.LightSteelBlue, System.Drawing.Color.LightYellow, System.Drawing.Color.Lime, System.Drawing.Color.LimeGreen, System.Drawing.Color.Linen, System.Drawing.Color.Magenta, System.Drawing.Color.Maroon, System.Drawing.Color.MediumAquamarine, System.Drawing.Color.MediumBlue, System.Drawing.Color.MediumOrchid, System.Drawing.Color.MediumPurple, System.Drawing.Color.MediumSeaGreen, System.Drawing.Color.MediumSlateBlue, System.Drawing.Color.MediumSpringGreen, System.Drawing.Color.MediumTurquoise, System.Drawing.Color.MediumVioletRed, System.Drawing.Color.MidnightBlue, System.Drawing.Color.MintCream, System.Drawing.Color.MistyRose, System.Drawing.Color.Moccasin, System.Drawing.Color.NavajoWhite, System.Drawing.Color.Navy, System.Drawing.Color.OldLace, System.Drawing.Color.Olive, System.Drawing.Color.OliveDrab, System.Drawing.Color.Orange, System.Drawing.Color.OrangeRed, System.Drawing.Color.Orchid, System.Drawing.Color.PaleGoldenrod, System.Drawing.Color.PaleGreen, System.Drawing.Color.PaleTurquoise, System.Drawing.Color.PaleVioletRed, System.Drawing.Color.PapayaWhip, System.Drawing.Color.PeachPuff, System.Drawing.Color.Peru, System.Drawing.Color.Pink, System.Drawing.Color.Plum, System.Drawing.Color.PowderBlue, System.Drawing.Color.Purple, System.Drawing.Color.Red, System.Drawing.Color.RosyBrown, System.Drawing.Color.RoyalBlue, System.Drawing.Color.SaddleBrown, System.Drawing.Color.Salmon, System.Drawing.Color.SandyBrown, System.Drawing.Color.SeaGreen, System.Drawing.Color.SeaShell, System.Drawing.Color.Sienna, System.Drawing.Color.Silver, System.Drawing.Color.SkyBlue, System.Drawing.Color.SlateBlue, System.Drawing.Color.SlateGray, System.Drawing.Color.Snow, System.Drawing.Color.SpringGreen, System.Drawing.Color.SteelBlue, System.Drawing.Color.Tan, System.Drawing.Color.Teal, System.Drawing.Color.Thistle, System.Drawing.Color.Tomato, System.Drawing.Color.Turquoise, System.Drawing.Color.Violet, System.Drawing.Color.Wheat, System.Drawing.Color.White, System.Drawing.Color.WhiteSmoke, System.Drawing.Color.Yellow, System.Drawing.Color.YellowGreen, System.Drawing.Color.AliceBlue, System.Drawing.Color.AntiqueWhite, System.Drawing.Color.Aqua, System.Drawing.Color.Aquamarine, System.Drawing.Color.Azure, System.Drawing.Color.Beige, System.Drawing.Color.Bisque, System.Drawing.Color.Black, System.Drawing.Color.BlanchedAlmond, System.Drawing.Color.Blue, System.Drawing.Color.BlueViolet, System.Drawing.Color.Brown, System.Drawing.Color.BurlyWood, System.Drawing.Color.CadetBlue, System.Drawing.Color.Chartreuse, System.Drawing.Color.Chocolate, System.Drawing.Color.Coral, System.Drawing.Color.CornflowerBlue, System.Drawing.Color.Cornsilk, System.Drawing.Color.Crimson, System.Drawing.Color.Cyan, System.Drawing.Color.DarkBlue, System.Drawing.Color.DarkCyan, System.Drawing.Color.DarkGoldenrod, System.Drawing.Color.DarkGray, System.Drawing.Color.DarkGreen, System.Drawing.Color.DarkKhaki, System.Drawing.Color.DarkMagenta, System.Drawing.Color.DarkOliveGreen, System.Drawing.Color.DarkOrange, System.Drawing.Color.DarkOrchid, System.Drawing.Color.DarkRed, System.Drawing.Color.DarkSalmon, System.Drawing.Color.DarkSeaGreen, System.Drawing.Color.DarkSlateBlue, System.Drawing.Color.DarkSlateGray, System.Drawing.Color.DarkTurquoise, System.Drawing.Color.DarkViolet, System.Drawing.Color.DeepPink, System.Drawing.Color.DeepSkyBlue, System.Drawing.Color.DimGray, System.Drawing.Color.DodgerBlue, System.Drawing.Color.Firebrick, System.Drawing.Color.FloralWhite, System.Drawing.Color.ForestGreen, System.Drawing.Color.Fuchsia, System.Drawing.Color.Gainsboro, System.Drawing.Color.GhostWhite, System.Drawing.Color.Gold, System.Drawing.Color.Goldenrod, System.Drawing.Color.Gray, System.Drawing.Color.Green, System.Drawing.Color.GreenYellow, System.Drawing.Color.Honeydew, System.Drawing.Color.HotPink, System.Drawing.Color.IndianRed, System.Drawing.Color.Indigo, System.Drawing.Color.Ivory, System.Drawing.Color.Khaki, System.Drawing.Color.Lavender, System.Drawing.Color.LavenderBlush, System.Drawing.Color.LawnGreen, System.Drawing.Color.LemonChiffon, System.Drawing.Color.LightBlue, System.Drawing.Color.LightCoral, System.Drawing.Color.LightCyan, System.Drawing.Color.LightGoldenrodYellow, System.Drawing.Color.LightGreen, System.Drawing.Color.LightGray, System.Drawing.Color.LightPink, System.Drawing.Color.LightSalmon, System.Drawing.Color.LightSeaGreen, System.Drawing.Color.LightSkyBlue, System.Drawing.Color.LightSlateGray, System.Drawing.Color.LightSteelBlue, System.Drawing.Color.LightYellow, System.Drawing.Color.Lime, System.Drawing.Color.LimeGreen, System.Drawing.Color.Linen, System.Drawing.Color.Magenta, System.Drawing.Color.Maroon, System.Drawing.Color.MediumAquamarine, System.Drawing.Color.MediumBlue, System.Drawing.Color.MediumOrchid, System.Drawing.Color.MediumPurple, System.Drawing.Color.MediumSeaGreen, System.Drawing.Color.MediumSlateBlue, System.Drawing.Color.MediumSpringGreen, System.Drawing.Color.MediumTurquoise, System.Drawing.Color.MediumVioletRed, System.Drawing.Color.MidnightBlue, System.Drawing.Color.MintCream, System.Drawing.Color.MistyRose, System.Drawing.Color.Moccasin, System.Drawing.Color.NavajoWhite, System.Drawing.Color.Navy, System.Drawing.Color.OldLace, System.Drawing.Color.Olive, System.Drawing.Color.OliveDrab, System.Drawing.Color.Orange, System.Drawing.Color.OrangeRed, System.Drawing.Color.Orchid, System.Drawing.Color.PaleGoldenrod, System.Drawing.Color.PaleGreen, System.Drawing.Color.PaleTurquoise, System.Drawing.Color.PaleVioletRed, System.Drawing.Color.PapayaWhip, System.Drawing.Color.PeachPuff, System.Drawing.Color.Peru, System.Drawing.Color.Pink, System.Drawing.Color.Plum, System.Drawing.Color.PowderBlue, System.Drawing.Color.Purple, System.Drawing.Color.Red, System.Drawing.Color.RosyBrown, System.Drawing.Color.RoyalBlue, System.Drawing.Color.SaddleBrown, System.Drawing.Color.Salmon, System.Drawing.Color.SandyBrown, System.Drawing.Color.SeaGreen, System.Drawing.Color.SeaShell, System.Drawing.Color.Sienna, System.Drawing.Color.Silver, System.Drawing.Color.SkyBlue, System.Drawing.Color.SlateBlue, System.Drawing.Color.SlateGray, System.Drawing.Color.Snow, System.Drawing.Color.SpringGreen, System.Drawing.Color.SteelBlue, System.Drawing.Color.Tan, System.Drawing.Color.Teal, System.Drawing.Color.Thistle, System.Drawing.Color.Tomato, System.Drawing.Color.Turquoise, System.Drawing.Color.Violet, System.Drawing.Color.Wheat, System.Drawing.Color.White, System.Drawing.Color.WhiteSmoke, System.Drawing.Color.Yellow, System.Drawing.Color.YellowGreen, System.Drawing.Color.AliceBlue, System.Drawing.Color.AntiqueWhite, System.Drawing.Color.Aqua, System.Drawing.Color.Aquamarine, System.Drawing.Color.Azure, System.Drawing.Color.Beige, System.Drawing.Color.Bisque, System.Drawing.Color.Black, System.Drawing.Color.BlanchedAlmond, System.Drawing.Color.Blue, System.Drawing.Color.BlueViolet, System.Drawing.Color.Brown, System.Drawing.Color.BurlyWood, System.Drawing.Color.CadetBlue, System.Drawing.Color.Chartreuse, System.Drawing.Color.Chocolate, System.Drawing.Color.Coral, System.Drawing.Color.CornflowerBlue, System.Drawing.Color.Cornsilk, System.Drawing.Color.Crimson, System.Drawing.Color.Cyan, System.Drawing.Color.DarkBlue, System.Drawing.Color.DarkCyan, System.Drawing.Color.DarkGoldenrod, System.Drawing.Color.DarkGray, System.Drawing.Color.DarkGreen, System.Drawing.Color.DarkKhaki, System.Drawing.Color.DarkMagenta, System.Drawing.Color.DarkOliveGreen, System.Drawing.Color.DarkOrange, System.Drawing.Color.DarkOrchid, System.Drawing.Color.DarkRed, System.Drawing.Color.DarkSalmon, System.Drawing.Color.DarkSeaGreen, System.Drawing.Color.DarkSlateBlue, System.Drawing.Color.DarkSlateGray, System.Drawing.Color.DarkTurquoise, System.Drawing.Color.DarkViolet, System.Drawing.Color.DeepPink, System.Drawing.Color.DeepSkyBlue, System.Drawing.Color.DimGray, System.Drawing.Color.DodgerBlue, System.Drawing.Color.Firebrick, System.Drawing.Color.FloralWhite, System.Drawing.Color.ForestGreen, System.Drawing.Color.Fuchsia, System.Drawing.Color.Gainsboro, System.Drawing.Color.GhostWhite, System.Drawing.Color.Gold, System.Drawing.Color.Goldenrod, System.Drawing.Color.Gray, System.Drawing.Color.Green, System.Drawing.Color.GreenYellow, System.Drawing.Color.Honeydew, System.Drawing.Color.HotPink, System.Drawing.Color.IndianRed, System.Drawing.Color.Indigo, System.Drawing.Color.Ivory, System.Drawing.Color.Khaki, System.Drawing.Color.Lavender, System.Drawing.Color.LavenderBlush, System.Drawing.Color.LawnGreen, System.Drawing.Color.LemonChiffon, System.Drawing.Color.LightBlue, System.Drawing.Color.LightCoral, System.Drawing.Color.LightCyan, System.Drawing.Color.LightGoldenrodYellow, System.Drawing.Color.LightGreen, System.Drawing.Color.LightGray, System.Drawing.Color.LightPink, System.Drawing.Color.LightSalmon, System.Drawing.Color.LightSeaGreen, System.Drawing.Color.LightSkyBlue, System.Drawing.Color.LightSlateGray, System.Drawing.Color.LightSteelBlue, System.Drawing.Color.LightYellow, System.Drawing.Color.Lime, System.Drawing.Color.LimeGreen, System.Drawing.Color.Linen, System.Drawing.Color.Magenta, System.Drawing.Color.Maroon, System.Drawing.Color.MediumAquamarine, System.Drawing.Color.MediumBlue, System.Drawing.Color.MediumOrchid, System.Drawing.Color.MediumPurple, System.Drawing.Color.MediumSeaGreen, System.Drawing.Color.MediumSlateBlue, System.Drawing.Color.MediumSpringGreen, System.Drawing.Color.MediumTurquoise, System.Drawing.Color.MediumVioletRed, System.Drawing.Color.MidnightBlue, System.Drawing.Color.MintCream, System.Drawing.Color.MistyRose, System.Drawing.Color.Moccasin, System.Drawing.Color.NavajoWhite, System.Drawing.Color.Navy, System.Drawing.Color.OldLace, System.Drawing.Color.Olive, System.Drawing.Color.OliveDrab, System.Drawing.Color.Orange, System.Drawing.Color.OrangeRed, System.Drawing.Color.Orchid, System.Drawing.Color.PaleGoldenrod, System.Drawing.Color.PaleGreen, System.Drawing.Color.PaleTurquoise, System.Drawing.Color.PaleVioletRed, System.Drawing.Color.PapayaWhip, System.Drawing.Color.PeachPuff, System.Drawing.Color.Peru, System.Drawing.Color.Pink, System.Drawing.Color.Plum, System.Drawing.Color.PowderBlue, System.Drawing.Color.Purple, System.Drawing.Color.Red, System.Drawing.Color.RosyBrown, System.Drawing.Color.RoyalBlue, System.Drawing.Color.SaddleBrown, System.Drawing.Color.Salmon, System.Drawing.Color.SandyBrown, System.Drawing.Color.SeaGreen, System.Drawing.Color.SeaShell, System.Drawing.Color.Sienna, System.Drawing.Color.Silver, System.Drawing.Color.SkyBlue, System.Drawing.Color.SlateBlue, System.Drawing.Color.SlateGray, System.Drawing.Color.Snow, System.Drawing.Color.SpringGreen, System.Drawing.Color.SteelBlue, System.Drawing.Color.Tan, System.Drawing.Color.Teal, System.Drawing.Color.Thistle, System.Drawing.Color.Tomato, System.Drawing.Color.Turquoise, System.Drawing.Color.Violet, System.Drawing.Color.Wheat, System.Drawing.Color.White, System.Drawing.Color.WhiteSmoke, System.Drawing.Color.Yellow, System.Drawing.Color.YellowGreen}); this.m_colorList.Location = new System.Drawing.Point(6, 10); this.m_colorList.MultiColumn = true; this.m_colorList.Name = "m_colorList"; this.m_colorList.Size = new System.Drawing.Size(506, 238); this.m_colorList.TabIndex = 0; // // m_cancel // this.m_cancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.m_cancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; this.m_cancel.Location = new System.Drawing.Point(452, 293); this.m_cancel.Name = "m_cancel"; this.m_cancel.Size = new System.Drawing.Size(75, 23); this.m_cancel.TabIndex = 2; this.m_cancel.Text = "&Cancel"; this.m_cancel.UseVisualStyleBackColor = true; // // m_ok // this.m_ok.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.m_ok.DialogResult = System.Windows.Forms.DialogResult.OK; this.m_ok.Location = new System.Drawing.Point(371, 293); this.m_ok.Name = "m_ok"; this.m_ok.Size = new System.Drawing.Size(75, 23); this.m_ok.TabIndex = 2; this.m_ok.Text = "&OK"; this.m_ok.UseVisualStyleBackColor = true; // // ColorPickerDialog // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(534, 326); this.Controls.Add(this.m_ok); this.Controls.Add(this.m_cancel); this.Controls.Add(this.m_tabControl); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; this.MaximizeBox = false; this.MinimizeBox = false; this.Name = "ColorPickerDialog"; this.Text = "Color Picker"; this.m_tabControl.ResumeLayout(false); this.m_knownColorsTabPage.ResumeLayout(false); this.ResumeLayout(false); }
private Control GetEditorControl (object value) { TabControl tab_control = new TabControl(); tab_control.Dock = DockStyle.Fill; TabPage custom_tab = new TabPage("Custom"); TabPage web_tab = new TabPage("Web"); TabPage system_tab = new TabPage("System"); ColorListBox web_listbox = new ColorListBox(); ColorListBox system_listbox = new ColorListBox(); web_listbox.Dock = DockStyle.Fill; system_listbox.Dock = DockStyle.Fill; web_tab.Controls.Add(web_listbox); system_tab.Controls.Add(system_listbox); SystemColorCompare system_compare = new SystemColorCompare(); System.Collections.ArrayList color_list = new System.Collections.ArrayList(); foreach (System.Reflection.PropertyInfo property in typeof(SystemColors).GetProperties(System.Reflection.BindingFlags.Public |System.Reflection.BindingFlags.Static)) { Color clr = (Color)property.GetValue(null,null); color_list.Add(clr); } color_list.Sort(system_compare); system_listbox.Items.AddRange(color_list.ToArray()); system_listbox.MouseUp+=new MouseEventHandler(HandleMouseUp); system_listbox.SelectedValueChanged+=new EventHandler(HandleChange); WebColorCompare web_compare = new WebColorCompare(); color_list = new System.Collections.ArrayList(); foreach (KnownColor known_color in Enum.GetValues(typeof(KnownColor))) { Color color = Color.FromKnownColor(known_color); if (color.IsSystemColor) continue; color_list.Add(color); } color_list.Sort(web_compare); web_listbox.Items.AddRange(color_list.ToArray()); web_listbox.MouseUp+=new MouseEventHandler(HandleMouseUp); web_listbox.SelectedValueChanged+=new EventHandler(HandleChange); CustomColorPicker custom_picker = new CustomColorPicker (); custom_picker.Dock = DockStyle.Fill; custom_picker.ColorChanged += new EventHandler (CustomColorPicked); custom_tab.Controls.Add (custom_picker); tab_control.TabPages.Add(custom_tab); tab_control.TabPages.Add(web_tab); tab_control.TabPages.Add(system_tab); if (value != null) { Color current_color = (Color)value; if (current_color.IsSystemColor) { system_listbox.SelectedValue = current_color; tab_control.SelectedTab = system_tab; } else if (current_color.IsKnownColor) { web_listbox.SelectedValue = current_color; tab_control.SelectedTab = web_tab; } selected_color = current_color; color_chosen = true; } tab_control.Height = 216; // the height of the custom colors tab return tab_control; }
/// <summary> /// Initializes a control, should be called before using the control. /// </summary> /// <param name="background">The initial value to edit.</param> /// <param name="allowGradient">Indicates whether the gradient brush editor is visible.</param> /// <param name="allowEmpty">Indicates whether the solid brush with Color.Empty can be specified, this value showed as "Auto" in editor.</param> /// <param name="emptyAlias">The text for Color.Empty color, typically it is displayed as "Auto".</param> public void Init(C1Brush background, bool allowGradient, bool allowEmpty, string emptyAlias) { _background = background ?? new C1SolidBrush(); Color solidColor = ConvertToSolidBrush(_background).Color; // BeginUpdate(); // initialize editors _webColorsEditor = new ColorListBox { BorderStyle = BorderStyle.None, Dock = DockStyle.Fill, FormattingEnabled = true, Name = "clbWebColors", TabIndex = 0, ShowColors = ShowColors.Web, ShowEmpty = allowEmpty, EmptyColorAlias = emptyAlias, }; _webColorsEditor.SelectedIndexChanged += WebColorsEditor_SelectedIndexChanged; _webColorsEditor.MouseUp += WebColorsEditor_MouseUp; _systemColorsEditor = new ColorListBox { BorderStyle = BorderStyle.None, Dock = DockStyle.Fill, FormattingEnabled = true, Name = "clbSystemColors", TabIndex = 0, ShowColors = ShowColors.SystemColors, ShowEmpty = allowEmpty, EmptyColorAlias = emptyAlias, }; _systemColorsEditor.SelectedIndexChanged += SystemColorsEditor_SelectedIndexChanged; _systemColorsEditor.MouseUp += SystemColorsEditor_MouseUp; _customColorEditor = new CustomColorEditor { Dock = DockStyle.Fill, Name = "customColorEditor1", TabIndex = 0, AllowColorPicker = true, ShowEmpty = allowEmpty, EmptyColorAlias = emptyAlias, }; _customColorEditor.ColorSelected += CustomColorEditor_ColorSelected; _customColorEditor.ColorChanged += CustomColorEditor_ColorChanged; _webColorsEditor.SelectedColor = solidColor; _systemColorsEditor.SelectedColor = solidColor; _customColorEditor.OldValue = solidColor; _customColorEditor.Value = solidColor; // dtpGradient.TabVisible = allowGradient; if (!allowGradient) { if (!(_background is C1SolidBrush)) { _background = new C1SolidBrush(solidColor); } } else { _gradientEditor = new GradientBackgroundEditor { Dock = DockStyle.Fill, Name = "gbeEditor", TabIndex = 0 }; _gradientEditor.BackgroundSelected += GradientEditor_BackgroundSelected; _gradientEditor.Changed += GradientEditor_Changed; _gradientEditor.Init(_background); } // if (_background is C1SolidBrush) { if (_systemColorsEditor.SelectedIndex >= 0) { dtMain.SelectedTab = dtpSystemColors; } else if (_webColorsEditor.SelectedIndex >= 0) { dtMain.SelectedTab = dtpWebColors; } else { dtMain.SelectedTab = dtpCustom; } } else { dtMain.SelectedTab = dtpGradient; } // EnsureEditorAdded(dtMain.SelectedIndex); dtMain.SelectedIndexChanging += (s, e) => EnsureEditorAdded(e.NewIndex); // EndUpdate(); }