BinaryOfficeColorPickerComboBox
A ComboBox styled ColorPicker control emulating the MS Office style color picker.
public class BinaryOfficeColorPickerComboBox : System.Windows.Forms.ComboBox
Inherits from / implements: System.Windows.Forms.ComboBox
Members at a glance
BinaryOfficeColorPickerComboBox | Initializes a new instance of BinaryColorPickerComboBox class. |
AlphaBlendFactorForControlPainting | Gets or sets the Alpha blending factor value for use when painting the control. |
AlphaBlendFactorForDropDownPressedColor | Gets or sets the Alpha blending factor value for use when painting the "pressed" state of the control. |
AlphaBlendFactorForItemSelectionColor | Gets or sets the Alpha blending factor value for use when painting the Item selection background. |
AlphaValue | Gets or sets the alpha value. |
BlendTargetColor | Gets or sets the color of the blend target. |
BorderColor | Gets or sets the color of the drop-down window's border. |
CustomColorForRectangleBorder | Gets or sets the Border color for painting the border for custom color boxes in the dropdown color control. |
CustomControlBorderColor | Gets or sets the Color value for painting the Control's border. |
CustomPaintingColor | Gets or sets the Color value for painting the Control. |
EnableSettingAlphaValue | Gets or sets a value indicating whether to enable setting alpha value. |
HeadingBackColor | Gets or sets the backcolor of the heading. |
HeadingForeColor | Gets or sets the forecolor of the heading. |
RightToLeft | RightToLeft is currently not supported. Planned for future release. |
SelectedColor | Gets or sets the currently selected color in the ColorPicker combobox control. |
SelectedColorRectangleBorder | Gets or sets the selected rectangle's border color. |
ShowBorderAlways | Gets or sets whether the control will always have its border displayed, even when the control is not currently in focus. |
ShowColorNameIfKnownColor | Gets or sets whether to show the color name in the combobox text area, if the chosen/selected/set color is a known color (refer to IsKnownColor for more details). |
ShowHSBInToolTip | Gets or sets a value indicating whether to show HSB in tooltip. |
ShowToolTip | Gets or sets a value indicating whether to show tooltip. |
Dispose | Releases the resources held by this BinaryOfficeColorPickerComboBox. |
DrawComboBoxFace | Draws the closed control: the selected color, its text and the drop-down button. |
DrawComboBoxFaceBackground | Draws the background of the closed control. Override to change the control background without taking over the swatch, the text and the button. |
DrawDisabledFace | Draws the control in its disabled form. |
DrawDisabledFaceBackground | Draws the background behind the disabled control. Override to change the disabled look without taking over the rest of the painting. |
DrawListItem | Draws one row of the drop-down list: its background, its color swatch and its text. |
DrawListItemBackground | Draws the background of one row of the drop-down list. Override to change the row background without taking over the swatch and the text. |
MeasureTextViaGdi | Measures text the way GDI draws it, which is not the same as the GDI+ measurement Graphics.MeasureString gives and is what the row heights have to be based on. |
OnDrawItem | Raises the DrawItem event. BinaryOfficeColorPickerComboBox overrides it so the control's own handling runs alongside the base behavior. |
OnGotFocus | Raises the GotFocus event. BinaryOfficeColorPickerComboBox overrides it so the control's own handling runs alongside the base behavior. |
OnHandleCreated | Raises the HandleCreated event. BinaryOfficeColorPickerComboBox overrides it so the control's own handling runs alongside the base behavior. |
OnKeyPress | Raises the KeyPress event. BinaryOfficeColorPickerComboBox overrides it so the control's own handling runs alongside the base behavior. |
OnLostFocus | Raises the LostFocus event. BinaryOfficeColorPickerComboBox overrides it so the control's own handling runs alongside the base behavior. |
OnMouseEnter | Raises the MouseEnter event. BinaryOfficeColorPickerComboBox overrides it so the control's own handling runs alongside the base behavior. |
OnMouseLeave | Raises the MouseLeave event. BinaryOfficeColorPickerComboBox overrides it so the control's own handling runs alongside the base behavior. |
OnPaint | Raises the Paint event. BinaryOfficeColorPickerComboBox overrides it so the control's own handling runs alongside the base behavior. |
OnSelectedIndexChanged | Raises the SelectedIndexChanged event. BinaryOfficeColorPickerComboBox overrides it so the control's own handling runs alongside the base behavior. |
SetFontHeight | Sets the item height of the drop-down list from a measured font height. |
WndProc | Processes the Windows messages sent to this control's window. |
SelectedColorChanged | Fires when the SelectedColor property changes or when the current color is changed by the user (or in the code) by selecting a new color value form the dropdown colorpicker. |
DropDownButtonWidth | Width in pixels of the drop-down button at the right-hand end of the control. |
Constructors
BinaryOfficeColorPickerComboBox
Initializes a new instance of BinaryColorPickerComboBox class.
Properties
AlphaBlendFactorForControlPainting
Gets or sets the Alpha blending factor value for use when painting the control.
Value. A Int32 value.
AlphaBlendFactorForDropDownPressedColor
Gets or sets the Alpha blending factor value for use when painting the "pressed" state of the control.
Value. A Int32 value.
AlphaBlendFactorForItemSelectionColor
Gets or sets the Alpha blending factor value for use when painting the Item selection background.
Value. A Int32 value.
AlphaValue
Gets or sets the alpha value.
Value. The alpha value.
BlendTargetColor
Gets or sets the color of the blend target.
Value. The color of the blend target.
BorderColor
Gets or sets the color of the drop-down window's border.
Value. The color of the border.
CustomColorForRectangleBorder
Gets or sets the Border color for painting the border for custom color boxes in the dropdown color control.
CustomControlBorderColor
Gets or sets the Color value for painting the Control's border.
Value. A Color value.
Color value of your choice, to paint the control's border. By default, this property is set to
Highlight value. CustomPaintingColor
Gets or sets the Color value for painting the Control.
Value. A Color value.
Color value of your choice, to paint the control. By default, this property is set to
Highlight value. EnableSettingAlphaValue
Gets or sets a value indicating whether to enable setting alpha value.
HeadingBackColor
Gets or sets the backcolor of the heading.
Value. The color of the heading back.
HeadingForeColor
Gets or sets the forecolor of the heading.
Value. The color of the heading fore.
RightToLeft
RightToLeft is currently not supported. Planned for future release.
SelectedColor
Gets or sets the currently selected color in the ColorPicker combobox control.
SelectedColorRectangleBorder
Gets or sets the selected rectangle's border color.
Value. The selected color rectangle border color.
ShowBorderAlways
Gets or sets whether the control will always have its border displayed, even when the control is not currently in focus.
By default, this property is set to false.
ShowColorNameIfKnownColor
Gets or sets whether to show the color name in the combobox text area, if the chosen/selected/set color is a known color (refer to IsKnownColor for more details).
ShowHSBInToolTip
Gets or sets a value indicating whether to show HSB in tooltip.
ShowToolTip
Gets or sets a value indicating whether to show tooltip.
Methods
Dispose
Releases the resources held by this BinaryOfficeColorPickerComboBox.
- disposing
- true when called from
Dispose; false when called from the finalizer.
DrawComboBoxFace
Draws the closed control: the selected color, its text and the drop-down button.
- g
- The surface to draw on.
- bounds
- The bounds of the control face.
- index
- The index of the selected item.
- isSelected
- true when the control is showing a selection.
- hasFocus
- true when the control has the focus.
DrawComboBoxFaceBackground
Draws the background of the closed control. Override to change the control background without taking over the swatch, the text and the button.
- g
- The surface to draw on.
- bounds
- The bounds of the control face.
- Index
- The index of the selected item.
- isSelected
- true when the control is showing a selection.
- hasFocus
- true when the control has the focus.
DrawDisabledFace
Draws the control in its disabled form.
DrawDisabledFaceBackground
Draws the background behind the disabled control. Override to change the disabled look without taking over the rest of the painting.
DrawListItem
Draws one row of the drop-down list: its background, its color swatch and its text.
- g
- The surface to draw on.
- bounds
- The bounds of the row.
- index
- The index of the item being drawn.
- isSelected
- true when the row is the selected one.
- hasFocus
- true when the row also has the focus rectangle.
DrawListItemBackground
Draws the background of one row of the drop-down list. Override to change the row background without taking over the swatch and the text.
- g
- The surface to draw on.
- bounds
- The bounds of the row.
- Index
- The index of the item being drawn.
- isSelected
- true when the row is the selected one.
- hasFocus
- true when the row also has the focus rectangle.
MeasureTextViaGdi
Measures text the way GDI draws it, which is not the same as the GDI+ measurement Graphics.MeasureString gives and is what the row heights have to be based on.
- graphics
- A graphics context to measure against.
- text
- The text to measure.
- font
- The font it will be drawn in.
Returns. The size the text occupies.
OnDrawItem
Raises the DrawItem event. BinaryOfficeColorPickerComboBox overrides it so the control's own handling runs alongside the base behavior.
- e
- The data for the event.
OnGotFocus
Raises the GotFocus event. BinaryOfficeColorPickerComboBox overrides it so the control's own handling runs alongside the base behavior.
- e
- The data for the event.
OnHandleCreated
Raises the HandleCreated event. BinaryOfficeColorPickerComboBox overrides it so the control's own handling runs alongside the base behavior.
- e
- The data for the event.
OnKeyPress
Raises the KeyPress event. BinaryOfficeColorPickerComboBox overrides it so the control's own handling runs alongside the base behavior.
- e
- The data for the event.
OnLostFocus
Raises the LostFocus event. BinaryOfficeColorPickerComboBox overrides it so the control's own handling runs alongside the base behavior.
- e
- The data for the event.
OnMouseEnter
Raises the MouseEnter event. BinaryOfficeColorPickerComboBox overrides it so the control's own handling runs alongside the base behavior.
- e
- The data for the event.
OnMouseLeave
Raises the MouseLeave event. BinaryOfficeColorPickerComboBox overrides it so the control's own handling runs alongside the base behavior.
- e
- The data for the event.
OnPaint
Raises the Paint event. BinaryOfficeColorPickerComboBox overrides it so the control's own handling runs alongside the base behavior.
- pe
- The data for the event.
OnSelectedIndexChanged
Raises the SelectedIndexChanged event. BinaryOfficeColorPickerComboBox overrides it so the control's own handling runs alongside the base behavior.
- e
- The data for the event.
SetFontHeight
Sets the item height of the drop-down list from a measured font height.
- s
- The height, in pixels.
WndProc
Processes the Windows messages sent to this control's window.
Events
SelectedColorChanged
Fires when the SelectedColor property changes or when the current color is changed by the user (or in the code) by selecting a new color value form the dropdown colorpicker.
Fields
DropDownButtonWidth
Width in pixels of the drop-down button at the right-hand end of the control.