SIL.FieldWorks.Common.Controls.ColorPickerDropDown.ColorPickerDropDown C# (CSharp) Method

ColorPickerDropDown() public method

Encapsulates a color picker drop-down almost just like Word 2003's.
public ColorPickerDropDown ( bool fShowUnspecified, Color selectedColor ) : System
fShowUnspecified bool if set to true control will include a button /// for the "automatic" choice (i.e., not explicitly specified).
selectedColor Color Initial color to select.
return System
		public ColorPickerDropDown(bool fShowUnspecified, Color selectedColor)
		{
			LayoutStyle = ToolStripLayoutStyle.VerticalStackWithOverflow;

			if (fShowUnspecified)
			{
				// Add the "Automatic" button.
				m_autoItem = new ToolStripButton(ColorPickerStrings.kstidUnspecifiedText);
				m_autoItem.TextAlign = ContentAlignment.MiddleCenter;
				m_autoItem.Click += new EventHandler(m_autoItem_Click);
				m_autoItem.Margin = new Padding(1, m_autoItem.Margin.Top,
					m_autoItem.Margin.Right, m_autoItem.Margin.Bottom);

				Items.Add(m_autoItem);
			}

			// Add all the colored squares.
			m_colorMatrix = new ColorPickerMatrix();
			m_colorMatrix.ColorPicked += new EventHandler(m_colorMatrix_ColorPicked);
			ToolStripControlHost host = new ToolStripControlHost(m_colorMatrix);
			host.AutoSize = false;
			host.Size = new Size(m_colorMatrix.Width + 6, m_colorMatrix.Height + 6);
			host.Padding = new Padding(3);
			Items.Add(host);

			// Add the "More Colors..." button.
			m_moreItem = new ToolStripMenuItem(ColorPickerStrings.kstidMoreColors);
			m_moreItem.TextAlign = ContentAlignment.MiddleCenter;
			m_moreItem.Click += new EventHandler(m_moreItem_Click);
			Items.Add(m_moreItem);

			CurrentColor = selectedColor;
		}