BinaryComboBox
BinaryComboBox - Base ComboBox class.
public abstract class BinaryComboBox : System.Windows.Forms.ComboBox
Inherits from / implements: System.Windows.Forms.ComboBox
Remarks
BinaryComboBox class represents the base abstract class for BinaryImageComboBox and BinaryTextComboBox classes.
This base class BinaryComboBox is not designed with an intention of deriving and creating classes other than the two specialist ComboBox classes BinaryTextComboBox and BinaryImageComboBox.
In order to customise the control, only derive from the specialist classes BinaryTextComboBox and BinaryImageComboBox.
Members at a glance
BinaryComboBox | Initializes a new instance of BinaryComboBox 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. |
ControlArrowColor | Gets or sets the color of the control's drop-down indicating arrow. |
CustomControlBorderColor | Gets or sets the Color value for painting the Control's border. |
CustomControlBorderColorWhenNotInFocus | The border color used while the control does not have the focus, when a custom border color is in effect. |
CustomControlDropDownButtonFillColorWhenNotInFocus | Gets or sets the custom control drop down button fill color when not in focus. |
CustomPaintingColor | Gets or sets the Color value for painting the Control. |
DropDownItemBorderColor | Gets or sets the color of each of the item in the dropdown window. |
DropDownItemTextAlignment | Gets or sets the text align of the item in the drop-down window. |
DropDownStyle | Since the control does not support Simple for its DropDownStyle, a new implementation is provided for this property. |
DropDownWindowBackgroundColor | Gets or sets the background color of the dropped-down window, when the control is not in multi-column drop style (refer DropStyleIsMultiColumn for what is multi-column drop style). |
DropDownWindowBorderColor | Gets or sets the color of the dropdown window border. |
DropDownWindowBorderThickness | Gets or sets the drop-down window border thickness. |
ExtendedDropdownButtonImage | Gets or sets the extended drop-down button image. This will draw the entire drop-down section using your image. The ideal size is 17 x 23 pixels. |
ExtendedDropdownButtonInternalImage | Gets or sets the extended drop-down button's internal image when using the default built in extended drop-down button. The ideal size is 6 x 6 pixels. |
IsInExtendedReadOnlyMode | Gets or sets whether the control is in extended read-only mode |
MultiColumnDropDownWindowBorderThickness | Gets or sets the multi-column drop-down window border thickness, in logical (96 DPI) units - scaled to the display the window opens on. Anything under 2 draws as 2. |
MultiColumnWindowColumnsHorizontalAlignments | Gets or sets the multi-column window columns horizontal alignments. |
ReflectCurrentXPThemeColorOnLoad | Gets or sets whether the control should paint itself based on the current active XP theme. |
RightToLeft | RightToLeft is currently not supported. Planned for future release. |
ShouldApplyMultiColumnWindowColumnsAlignmentsToAutoCompleteDropDown | Gets or sets a value indicating whether the control should apply the multi-column window columns alignments setting (as is MultiColumnWindowColumnsHorizontalAlignments to apply to the auto-complete multi-column drop down too. |
ShouldDisplayColumnHeadersWhenInMultiColumnMode | Gets or sets a value indicating whether the should display column headers when information multi column mode. |
ShouldDrawExtendedDropdownButton | Gets or sets a value indicating whether the control should draw extended drop down button for the drop down button section. |
ShowBorderAlways | Gets or sets whether the control will always have its border displayed, even when the control is not currently in focus. |
TextAlignment | Gets or sets the text align. |
UpdateWhenSystemColorsChanges | Gets or sets whether the control needs to repaint itself when the SystemColorsChanged event is raised. |
DropDownButtonExtent | The width of the drop-down button strip at the right of the control. |
EmulateThisXPTheme | Enables painting the control with XP theme colors. |
MakeBlank | This method helps to deterministically set the control's text area to blank. |
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 | Refer to base class documentation. |
OnGotFocus | Refer to base class documentation. |
OnHandleCreated | Refer to base class documentation. |
OnKeyPress | Refer to base class documentation. |
OnLostFocus | Refer to base class documentation. |
OnMouseEnter | Refer to base class documentation. |
OnMouseLeave | Refer to base class documentation. |
OnPaint | Refer to base class documentation. |
OnSelectedIndexChanged | Refer to base class documentation. |
OnSystemColorsChanged | Refer to base class documentation. |
PaintControlWithData | Draws the closed control for the item at the given index. Override to change how a selected item is presented on the control face. |
RefreshPaint | Redraws the control face after the selection changes, without a full layout pass. |
SetData | Refreshes the text drawn on the closed control from the current selection. The base handles the flat display style; a derived combo box overrides it for its own item shape. |
WndProc | Refer to base class documentation. |
DropDownButtonWidth | Width in pixels of the drop-down button at the right-hand end of the control. |
Constructors
BinaryComboBox
Initializes a new instance of BinaryComboBox 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.
ControlArrowColor
Gets or sets the color of the control's drop-down indicating arrow.
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. CustomControlBorderColorWhenNotInFocus
The border color used while the control does not have the focus, when a custom border color is in effect.
CustomControlDropDownButtonFillColorWhenNotInFocus
Gets or sets the custom control drop down button fill color when not in focus.
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. DropDownItemBorderColor
Gets or sets the color of each of the item in the dropdown window.
DropDownItemTextAlignment
Gets or sets the text align of the item in the drop-down window.
DropDownStyle
Since the control does not support Simple for its DropDownStyle, a new implementation is provided for this property.
DropDownWindowBackgroundColor
Gets or sets the background color of the dropped-down window, when the control is not in multi-column drop style (refer DropStyleIsMultiColumn for what is multi-column drop style).
DropDownWindowBorderColor
Gets or sets the color of the dropdown window border.
DropDownWindowBorderThickness
Gets or sets the drop-down window border thickness.
ExtendedDropdownButtonImage
Gets or sets the extended drop-down button image. This will draw the entire drop-down section using your image. The ideal size is 17 x 23 pixels.
ExtendedDropdownButtonInternalImage
Gets or sets the extended drop-down button's internal image when using the default built in extended drop-down button. The ideal size is 6 x 6 pixels.
IsInExtendedReadOnlyMode
Gets or sets whether the control is in extended read-only mode
MultiColumnDropDownWindowBorderThickness
Gets or sets the multi-column drop-down window border thickness, in logical (96 DPI) units - scaled to the display the window opens on. Anything under 2 draws as 2.
MultiColumnWindowColumnsHorizontalAlignments
Gets or sets the multi-column window columns horizontal alignments.
ReflectCurrentXPThemeColorOnLoad
Gets or sets whether the control should paint itself based on the current active XP theme.
Every time the hosting container (i.e. a Form, etc.) is loaded, the control will draw itself with the relevant colors to simulate the current active XP theme.
The default value is false.
RightToLeft
RightToLeft is currently not supported. Planned for future release.
ShouldApplyMultiColumnWindowColumnsAlignmentsToAutoCompleteDropDown
Gets or sets a value indicating whether the control should apply the multi-column window columns alignments setting (as is MultiColumnWindowColumnsHorizontalAlignments to apply to the auto-complete multi-column drop down too.
ShouldDisplayColumnHeadersWhenInMultiColumnMode
Gets or sets a value indicating whether the should display column headers when information multi column mode.
ShouldDrawExtendedDropdownButton
Gets or sets a value indicating whether the control should draw extended drop down button for the drop down button section.
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.
TextAlignment
Gets or sets the text align.
UpdateWhenSystemColorsChanges
Gets or sets whether the control needs to repaint itself when the SystemColorsChanged event is raised.
Methods
DropDownButtonExtent
The width of the drop-down button strip at the right of the control.
EmulateThisXPTheme
Enables painting the control with XP theme colors.
- theTheme
- A supported XP theme.
Note: The control Emulates painting the control with an XP theme as closely as possible.
This may not achieve an exact reproduction of XP theme color (since the simulation is custom drawn). This method can render the control with emulated XP theme colors even in Windows 2000 Operating System.
Refer to
XPTheme enumeration for the supported XP themes. Note: When this method is called, any values that has been already set for color properties
CustomPaintingColor, CustomControlBorderColor and alpha-blending factor properties AlphaBlendFactorForControlPainting, AlphaBlendFactorForDropDownPressedColor and AlphaBlendFactorForItemSelectionColor will be lost. If you need your custom values later (after calling this method), please save them temporarily in your application.
MakeBlank
This method helps to deterministically set the control's text area to blank.
SelectedIndexMeasureTextViaGdi
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
Refer to base class documentation.
OnGotFocus
Refer to base class documentation.
OnHandleCreated
Refer to base class documentation.
OnKeyPress
Refer to base class documentation.
OnLostFocus
Refer to base class documentation.
OnMouseEnter
Refer to base class documentation.
OnMouseLeave
Refer to base class documentation.
OnPaint
Refer to base class documentation.
OnSelectedIndexChanged
Refer to base class documentation.
OnSystemColorsChanged
Refer to base class documentation.
- e
PaintControlWithData
Draws the closed control for the item at the given index. Override to change how a selected item is presented on the control face.
- g
- The surface to draw on.
- bounds
- The bounds of the control face.
- Index
- The index of the item being shown.
- isSelected
- true when the control is showing a selection.
- toEdit
- true when the face is being drawn for editing rather than display.
RefreshPaint
Redraws the control face after the selection changes, without a full layout pass.
- g
- The surface to draw on.
- bounds
- The bounds of the control face.
- Index
- The index of the item being shown.
- isSelected
- true when the control is showing a selection.
- toEdit
- true when the face is being drawn for editing rather than display.
SetData
Refreshes the text drawn on the closed control from the current selection. The base handles the flat display style; a derived combo box overrides it for its own item shape.
WndProc
Refer to base class documentation.
Fields
DropDownButtonWidth
Width in pixels of the drop-down button at the right-hand end of the control.