BinaryColorPickerComboBox
A ComboBox styled ColorPicker control emulating the VS.NET color picker.
public class BinaryColorPickerComboBox : System.Windows.Forms.ComboBox
Inherits from / implements: System.Windows.Forms.ComboBox
Members at a glance
BinaryColorPickerComboBox | 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. |
CustomColorRectangleBorderStyle | Gets or sets the Border style ( i.e. Border3DStyle )for painting the borders of custom color boxes in the Custom colors tab page of 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. |
RightToLeft | RightToLeft is currently not supported. Planned for future release. |
SelectedColor | Gets or sets the currently selected color in the ColorPicker combobox control. |
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). |
Dispose | Releases the resources held by this BinaryColorPickerComboBox. |
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. BinaryColorPickerComboBox overrides it so the control's own handling runs alongside the base behavior. |
OnGotFocus | Raises the GotFocus event. BinaryColorPickerComboBox overrides it so the control's own handling runs alongside the base behavior. |
OnHandleCreated | Raises the HandleCreated event. BinaryColorPickerComboBox overrides it so the control's own handling runs alongside the base behavior. |
OnKeyPress | Raises the KeyPress event. BinaryColorPickerComboBox overrides it so the control's own handling runs alongside the base behavior. |
OnLostFocus | Raises the LostFocus event. BinaryColorPickerComboBox overrides it so the control's own handling runs alongside the base behavior. |
OnMouseEnter | Raises the MouseEnter event. BinaryColorPickerComboBox overrides it so the control's own handling runs alongside the base behavior. |
OnMouseLeave | Raises the MouseLeave event. BinaryColorPickerComboBox overrides it so the control's own handling runs alongside the base behavior. |
OnPaint | Raises the Paint event. BinaryColorPickerComboBox overrides it so the control's own handling runs alongside the base behavior. |
OnSelectedIndexChanged | Raises the SelectedIndexChanged event. BinaryColorPickerComboBox 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
BinaryColorPickerComboBox
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.
CustomColorRectangleBorderStyle
Gets or sets the Border style ( i.e. Border3DStyle )for painting the borders of custom color boxes in the Custom colors tab page of the dropdown color control.
Border3DStyle list.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. RightToLeft
RightToLeft is currently not supported. Planned for future release.
SelectedColor
Gets or sets the currently selected color in the ColorPicker combobox control.
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).
Methods
Dispose
Releases the resources held by this BinaryColorPickerComboBox.
- 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. BinaryColorPickerComboBox overrides it so the control's own handling runs alongside the base behavior.
- e
- The data for the event.
OnGotFocus
Raises the GotFocus event. BinaryColorPickerComboBox overrides it so the control's own handling runs alongside the base behavior.
- e
- The data for the event.
OnHandleCreated
Raises the HandleCreated event. BinaryColorPickerComboBox overrides it so the control's own handling runs alongside the base behavior.
- e
- The data for the event.
OnKeyPress
Raises the KeyPress event. BinaryColorPickerComboBox overrides it so the control's own handling runs alongside the base behavior.
- e
- The data for the event.
OnLostFocus
Raises the LostFocus event. BinaryColorPickerComboBox overrides it so the control's own handling runs alongside the base behavior.
- e
- The data for the event.
OnMouseEnter
Raises the MouseEnter event. BinaryColorPickerComboBox overrides it so the control's own handling runs alongside the base behavior.
- e
- The data for the event.
OnMouseLeave
Raises the MouseLeave event. BinaryColorPickerComboBox overrides it so the control's own handling runs alongside the base behavior.
- e
- The data for the event.
OnPaint
Raises the Paint event. BinaryColorPickerComboBox overrides it so the control's own handling runs alongside the base behavior.
- pe
- The data for the event.
OnSelectedIndexChanged
Raises the SelectedIndexChanged event. BinaryColorPickerComboBox 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.