BinaryDomainUpDown
BinaryDomainUpDown is an Extended, feature-rich and "flat" styled DomainUpDown navigation control for the Winforms .NET platform.
public class BinaryDomainUpDown : DomainUpDown
Inherits from / implements: DomainUpDown
Remarks
BinaryDomainUpDown is a feature-rich control to conveniently replace the standard .NET framework DomainUpDown control.
The control derives from the standard .NET framework DomainUpDown control and introduces new properties to provide a "flat" look-and-feel and some additional GUI features like supporting custom colors for drawing the control's borders, inner button controls, the up and down arrow marks and also providing the ever popular VS.NET/XP fame mouse hovering effects.
Members at a glance
BinaryDomainUpDown | Initializes a new instance of BinaryDomainUpDown class. |
BorderColor | Gets or sets the color of the control's border, when the mouse is over it or it has the focus. |
BorderStyle | The BinaryDomainUpDown control only supports a fixed 3D border style. |
DrawStyleIsFlat | Gets or sets whether the control is to be drawn with a "flat" look or with a 3D look. |
ShowBorderAlways | Gets or sets whether the control will always have its border displayed, even when the control is not currently in focus. |
UpDownArrowPressedBackColor | Gets or sets the color of the internal buttons (where the Up and Down arrows are painted), when they are in pressed state. |
UpDownArrowsColor | Gets or sets the color of the Up and down arrow marks. |
UpDownButtonNormalBackColor | Gets or sets the color of the internal buttons (where the Up and Down arrows are painted), when they are not in focussed state (when the input focus is not on them). |
UpDownButtonOnFocusBackColor | Gets or sets the color of the internal buttons (where the Up and Down arrows are painted), when they are in focussed state (when the input focus is on them). |
CreateHandle | Creates the window handle for this control. |
OnFontChanged | Raises the FontChanged event, re-fitting the spin button to the new font. |
OnGotFocus | Raises the GotFocus event. BinaryDomainUpDown overrides it so the control's own handling runs alongside the base behavior. |
OnLayout | Raises the Layout event. BinaryDomainUpDown overrides it so the spin button is sized from the control's own height and font rather than from a fixed constant. |
OnLostFocus | Raises the LostFocus event. BinaryDomainUpDown overrides it so the control's own handling runs alongside the base behavior. |
OnSystemColorsChanged | Raises the SystemColorsChanged event. BinaryDomainUpDown overrides it so the control's own handling runs alongside the base behavior. |
WndProc | Processes the Windows messages sent to this control's window. |
Constructors
BinaryDomainUpDown
Initializes a new instance of BinaryDomainUpDown class.
Properties
BorderColor
Gets or sets the color of the control's border, when the mouse is over it or it has the focus.
BorderStyle
The BinaryDomainUpDown control only supports a fixed 3D border style.
DrawStyleIsFlat
Gets or sets whether the control is to be drawn with a "flat" look or with a 3D look.
If you need to paint the control emulating the standard .NET framework
DomainUpDown 3D style, set this property to false.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 true.
UpDownArrowPressedBackColor
Gets or sets the color of the internal buttons (where the Up and Down arrows are painted), when they are in pressed state.
UpDownArrowsColor
Gets or sets the color of the Up and down arrow marks.
UpDownButtonNormalBackColor
Gets or sets the color of the internal buttons (where the Up and Down arrows are painted), when they are not in focussed state (when the input focus is not on them).
UpDownButtonOnFocusBackColor
Gets or sets the color of the internal buttons (where the Up and Down arrows are painted), when they are in focussed state (when the input focus is on them).
Methods
CreateHandle
Creates the window handle for this control.
OnFontChanged
Raises the FontChanged event, re-fitting the spin button to the new font.
- e
- The data for the event.
UpDownBase repositions its own children here directly rather than by asking for a layout, so without this the button would keep the width it had until something else resized the control.OnGotFocus
Raises the GotFocus event. BinaryDomainUpDown overrides it so the control's own handling runs alongside the base behavior.
- e
- The data for the event.
OnLayout
Raises the Layout event. BinaryDomainUpDown overrides it so the spin button is sized from the control's own height and font rather than from a fixed constant.
- e
- The data for the event.
UpDownBase gives the spin button a fixed 16 unit width. On a 250% display carrying a large font that leaves a postage stamp of a button glued to the side of a control several times its height, with the text area sized from whatever is left over. Windows sizes its own spin buttons from SM_CXVSCROLL , which is DPI aware but takes no account of the font, so the width used here is the larger of that metric and a fraction of the font height - capped so the button can never take more than a third of a narrow control.
The arrows need no separate arithmetic: PaintTarget already sizes them from the button rectangle, so a wider button draws larger glyphs by itself.
OnLostFocus
Raises the LostFocus event. BinaryDomainUpDown overrides it so the control's own handling runs alongside the base behavior.
- e
- The data for the event.
OnSystemColorsChanged
Raises the SystemColorsChanged event. BinaryDomainUpDown overrides it so the control's own handling runs alongside the base behavior.
- e
- The data for the event.
WndProc
Processes the Windows messages sent to this control's window.