HypernovaDesktop Components · docs
Binarymission
WinForms › Time Picker › DropDownHostConfiguration

DropDownHostConfiguration

class.NET 6 / 8 / 10.NET Framework 4.8Binarymission.WinForms.Controls.Selectors.TimeSelectors

The look and behaviour of a TimePickerDropDown's text field, its drop-down button and the drop-down window: fonts, colours, borders, the drop-down's size and position, and its resize strip.

public sealed class DropDownHostConfiguration

Remarks

Reach it through TimePickerDropDown.DropDownHostConfiguration and change its properties there. Each change is applied to the control at once, or when the control's window is created.

The defaults given for each property are those of the configuration a TimePickerDropDown creates; a configuration made with new starts empty – no fonts, colours or size.

The parts it names: the text display visual is the field showing the time, the popup command visual is the button that opens the drop-down, and the resize section is the strip along the bottom of the drop-down that the user drags to resize it.

Examples

DropDownHostConfiguration look = shiftStart.DropDownHostConfiguration;

// The field and its button.
look.TextDisplayVisualFont = new Font("Segoe UI", 11f);
look.TextDisplayVisualTextForeColor = Color.Black;
look.TextDisplayVisualBorderColor = Color.SteelBlue;
look.PopupCommandVisualNormalBackColor = Color.SteelBlue;
look.PopupCommandVisualHoveredBackColor = Color.DodgerBlue;
look.PopupCommandVisualPressedBackColor = Color.Navy;

// The drop-down itself.
look.DropDownSize = new Size(280, 130);
look.ShouldRememberUserSizedDropDownSize = true;

Members at a glance

Properties
BorderThicknessGets or sets the width of the border round the time text.
DisplayLocationGets or sets where on the screen the drop-down opens, in place of just below the control.
DisplayTextVisualToTotalSizeRatioGets or sets how much of the control's width the time text takes; the drop-down button has the rest.
DropDownContentPaddingGets or sets the space between the drop-down's edge and the column area inside it.
DropDownResizeGripperColorGets or sets the colour of the grip marks on the drop-down's resize strip.
DropDownResizeSectionBorderColorGets or sets the colour of the border round the drop-down's resize strip.
DropDownResizeSectionFillColorGets or sets the colour of the resize strip along the bottom of the drop-down.
DropDownSizeGets or sets the size of the drop-down's column area.
EnableDropDownResizingGets or sets whether the user can resize the drop-down by dragging the strip along its bottom.
PopupCommandVisualBorderColorGets or sets the colour of the drop-down button's border at rest.
PopupCommandVisualBorderColorOnHoverGets or sets the colour of the drop-down button's border while the pointer is over it.
PopupCommandVisualBorderColorOnPressedGets or sets the colour of the drop-down button's border while it is pressed.
PopupCommandVisualFontGets or sets the font of PopupCommandVisualText on the drop-down button.
PopupCommandVisualHoverStateImageGets or sets the picture on the drop-down button while the pointer is over it.
PopupCommandVisualHoveredBackColorGets or sets the colour of the drop-down button while the pointer is over it.
PopupCommandVisualMaximumInternalImageDrawingSizeGets or sets the largest size the drop-down button's picture is drawn at, centred on the button.
PopupCommandVisualNormalBackColorGets or sets the colour of the drop-down button at rest.
PopupCommandVisualNormalStateImageGets or sets the picture on the drop-down button at rest – a clock face, say, in place of the arrow.
PopupCommandVisualPressedBackColorGets or sets the colour of the drop-down button while it is pressed.
PopupCommandVisualPressedStateImageGets or sets the picture on the drop-down button while it is pressed.
PopupCommandVisualShouldApplyPaddingWhilePositioningImageGets or sets whether a stretched button picture is kept in from the button's edges.
PopupCommandVisualTextGets or sets text to show on the drop-down button in place of its picture, such as "...".
PopupCommandVisualTextForeColorGets or sets the colour of PopupCommandVisualText on the drop-down button.
PopupContentHostGets or sets the control shown in the drop-down.
ShouldDrawBidirectionalResizeGripperGets or sets whether the resize strip shows a corner grip for dragging the drop-down's width and height together.
ShouldDrawDropDownResizeSectionWith3DBorderGets or sets whether the resize strip is drawn with a raised, 3D border rather than a flat one.
ShouldDrawDropShadowGets or sets whether the drop-down casts a shadow.
ShouldDrawVerticalResizeGripperGets or sets whether the resize strip shows grip marks for dragging the drop-down taller or shorter.
ShouldRememberUserSizedDropDownSizeGets or sets whether the drop-down reopens at the size the user last dragged it to.
TextDisplayVisualBackColorGets or sets the background colour of the control's text field.
TextDisplayVisualBorderColorGets or sets the colour of the border round the control's text field.
TextDisplayVisualBorderThicknessGets or sets the width of the border round the control's text field.
TextDisplayVisualFontGets or sets the font the time is shown in, in the control's text field.
TextDisplayVisualTextForeColorGets or sets the colour of the time in the control's text field.

Properties

BorderThickness

public float BorderThickness

Gets or sets the width of the border round the time text.

Value
In pixels. The default is 0.
Remarks

TextDisplayVisualBorderThickness sets the same border and is applied after this property, so it is the one that takes effect.

DisplayLocation

public Point DisplayLocation

Gets or sets where on the screen the drop-down opens, in place of just below the control.

Value
A point in screen coordinates for the drop-down's top-left corner. The default is (0, 0): below the control.

DisplayTextVisualToTotalSizeRatio

public float DisplayTextVisualToTotalSizeRatio

Gets or sets how much of the control's width the time text takes; the drop-down button has the rest.

Value
A percentage, from 0 to 100. The default is 80.

DropDownContentPadding

public Padding DropDownContentPadding

Gets or sets the space between the drop-down's edge and the column area inside it.

Value
The default is 0 on every side.

DropDownResizeGripperColor

public Color DropDownResizeGripperColor

Gets or sets the colour of the grip marks on the drop-down's resize strip.

Value
The default is Color.White.

DropDownResizeSectionBorderColor

public Color DropDownResizeSectionBorderColor

Gets or sets the colour of the border round the drop-down's resize strip.

Value
The default is Color.SlateGray.

DropDownResizeSectionFillColor

public Color DropDownResizeSectionFillColor

Gets or sets the colour of the resize strip along the bottom of the drop-down.

Value
The default is Color.SlateGray.

DropDownSize

public Size DropDownSize

Gets or sets the size of the drop-down's column area.

Value
In logical pixels. The default is 227 by 110. Size.Empty opens it at the columns' own size.
Remarks

The resize strip is added below this area. When the user resizes the drop-down and ShouldRememberUserSizedDropDownSize is set, the size they chose is used the next time it opens.

EnableDropDownResizing

public bool EnableDropDownResizing

Gets or sets whether the user can resize the drop-down by dragging the strip along its bottom.

Value
true to allow it. The default is true.
See also

PopupCommandVisualBorderColor

public Color PopupCommandVisualBorderColor

Gets or sets the colour of the drop-down button's border at rest.

Value
The default is Color.Chocolate.

PopupCommandVisualBorderColorOnHover

public Color PopupCommandVisualBorderColorOnHover

Gets or sets the colour of the drop-down button's border while the pointer is over it.

Value
The default is Color.DarkRed.

PopupCommandVisualBorderColorOnPressed

public Color PopupCommandVisualBorderColorOnPressed

Gets or sets the colour of the drop-down button's border while it is pressed.

Value
The default is Color.SlateGray.

PopupCommandVisualFont

public Font PopupCommandVisualFont

Gets or sets the font of PopupCommandVisualText on the drop-down button.

Value
The default is Microsoft Sans Serif, 12 points.

PopupCommandVisualHoverStateImage

public Bitmap PopupCommandVisualHoverStateImage

Gets or sets the picture on the drop-down button while the pointer is over it.

Value
The default is null: the built-in drop-down arrow.
See also

PopupCommandVisualHoveredBackColor

public Color PopupCommandVisualHoveredBackColor

Gets or sets the colour of the drop-down button while the pointer is over it.

Value
The default is Color.DarkRed.

PopupCommandVisualMaximumInternalImageDrawingSize

public Size PopupCommandVisualMaximumInternalImageDrawingSize

Gets or sets the largest size the drop-down button's picture is drawn at, centred on the button.

Value
In logical pixels. The default is 32 by 32. The picture is never drawn larger than the button.
Remarks

Size.Empty stretches the picture over the whole button, or over most of it when PopupCommandVisualShouldApplyPaddingWhilePositioningImage is set.

PopupCommandVisualNormalBackColor

public Color PopupCommandVisualNormalBackColor

Gets or sets the colour of the drop-down button at rest.

Value
The default is Color.Chocolate.

PopupCommandVisualNormalStateImage

public Bitmap PopupCommandVisualNormalStateImage

Gets or sets the picture on the drop-down button at rest – a clock face, say, in place of the arrow.

Value
The default is null: the built-in drop-down arrow.
Remarks

Not drawn while PopupCommandVisualText is set. Set the hover and pressed pictures too, or those states show the built-in arrow.

PopupCommandVisualPressedBackColor

public Color PopupCommandVisualPressedBackColor

Gets or sets the colour of the drop-down button while it is pressed.

Value
The default is Color.SlateGray.

PopupCommandVisualPressedStateImage

public Bitmap PopupCommandVisualPressedStateImage

Gets or sets the picture on the drop-down button while it is pressed.

Value
The default is null: the built-in drop-down arrow.

PopupCommandVisualShouldApplyPaddingWhilePositioningImage

public bool PopupCommandVisualShouldApplyPaddingWhilePositioningImage

Gets or sets whether a stretched button picture is kept in from the button's edges.

Value
true to draw it over about seven tenths of the button. The default is false.
Remarks

PopupCommandVisualText

public string PopupCommandVisualText

Gets or sets text to show on the drop-down button in place of its picture, such as "...".

Value
The default is null: the button shows its picture.
See also

PopupCommandVisualTextForeColor

public Color PopupCommandVisualTextForeColor

Gets or sets the colour of PopupCommandVisualText on the drop-down button.

Value
The default is SystemColors.WindowText.

PopupContentHost

public Control PopupContentHost

Gets or sets the control shown in the drop-down.

Value
The default is null.
Remarks

Not applied by TimePickerDropDown, which always shows its own hour, minute and second columns.

ShouldDrawBidirectionalResizeGripper

public bool ShouldDrawBidirectionalResizeGripper

Gets or sets whether the resize strip shows a corner grip for dragging the drop-down's width and height together.

Value
true to show it. The default is true.

ShouldDrawDropDownResizeSectionWith3DBorder

public bool ShouldDrawDropDownResizeSectionWith3DBorder

Gets or sets whether the resize strip is drawn with a raised, 3D border rather than a flat one.

Value
true for the 3D border. The default is false.

ShouldDrawDropShadow

public bool ShouldDrawDropShadow

Gets or sets whether the drop-down casts a shadow.

Value
The default is false.
Remarks

Not applied by TimePickerDropDown: the drop-down's shadow does not change with it.

ShouldDrawVerticalResizeGripper

public bool ShouldDrawVerticalResizeGripper

Gets or sets whether the resize strip shows grip marks for dragging the drop-down taller or shorter.

Value
true to show them. The default is true.

ShouldRememberUserSizedDropDownSize

public bool ShouldRememberUserSizedDropDownSize

Gets or sets whether the drop-down reopens at the size the user last dragged it to.

Value
true to remember the size. The default is false: it always opens at DropDownSize.

TextDisplayVisualBackColor

public Color TextDisplayVisualBackColor

Gets or sets the background colour of the control's text field.

Value
The default is SystemColors.Window.

TextDisplayVisualBorderColor

public Color TextDisplayVisualBorderColor

Gets or sets the colour of the border round the control's text field.

Value
The default is Color.SlateGray.

TextDisplayVisualBorderThickness

public int TextDisplayVisualBorderThickness

Gets or sets the width of the border round the control's text field.

Value
In pixels. The default is 1. 0 draws no border.

TextDisplayVisualFont

public Font TextDisplayVisualFont

Gets or sets the font the time is shown in, in the control's text field.

Value
The default is the Windows message box font family at 12 points.

TextDisplayVisualTextForeColor

public Color TextDisplayVisualTextForeColor

Gets or sets the colour of the time in the control's text field.

Value
The default is Color.SlateGray.