DropDownHostConfiguration
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 | |
|---|---|
BorderThickness | Gets or sets the width of the border round the time text. |
DisplayLocation | Gets or sets where on the screen the drop-down opens, in place of just below the control. |
DisplayTextVisualToTotalSizeRatio | Gets or sets how much of the control's width the time text takes; the drop-down button has the rest. |
DropDownContentPadding | Gets or sets the space between the drop-down's edge and the column area inside it. |
DropDownResizeGripperColor | Gets or sets the colour of the grip marks on the drop-down's resize strip. |
DropDownResizeSectionBorderColor | Gets or sets the colour of the border round the drop-down's resize strip. |
DropDownResizeSectionFillColor | Gets or sets the colour of the resize strip along the bottom of the drop-down. |
DropDownSize | Gets or sets the size of the drop-down's column area. |
EnableDropDownResizing | Gets or sets whether the user can resize the drop-down by dragging the strip along its bottom. |
PopupCommandVisualBorderColor | Gets or sets the colour of the drop-down button's border at rest. |
PopupCommandVisualBorderColorOnHover | Gets or sets the colour of the drop-down button's border while the pointer is over it. |
PopupCommandVisualBorderColorOnPressed | Gets or sets the colour of the drop-down button's border while it is pressed. |
PopupCommandVisualFont | Gets or sets the font of PopupCommandVisualText on the drop-down button. |
PopupCommandVisualHoverStateImage | Gets or sets the picture on the drop-down button while the pointer is over it. |
PopupCommandVisualHoveredBackColor | Gets or sets the colour of the drop-down button while the pointer is over it. |
PopupCommandVisualMaximumInternalImageDrawingSize | Gets or sets the largest size the drop-down button's picture is drawn at, centred on the button. |
PopupCommandVisualNormalBackColor | Gets or sets the colour of the drop-down button at rest. |
PopupCommandVisualNormalStateImage | Gets or sets the picture on the drop-down button at rest – a clock face, say, in place of the arrow. |
PopupCommandVisualPressedBackColor | Gets or sets the colour of the drop-down button while it is pressed. |
PopupCommandVisualPressedStateImage | Gets or sets the picture on the drop-down button while it is pressed. |
PopupCommandVisualShouldApplyPaddingWhilePositioningImage | Gets or sets whether a stretched button picture is kept in from the button's edges. |
PopupCommandVisualText | Gets or sets text to show on the drop-down button in place of its picture, such as "...". |
PopupCommandVisualTextForeColor | Gets or sets the colour of PopupCommandVisualText on the drop-down button. |
PopupContentHost | Gets or sets the control shown in the drop-down. |
ShouldDrawBidirectionalResizeGripper | Gets or sets whether the resize strip shows a corner grip for dragging the drop-down's width and height together. |
ShouldDrawDropDownResizeSectionWith3DBorder | Gets or sets whether the resize strip is drawn with a raised, 3D border rather than a flat one. |
ShouldDrawDropShadow | Gets or sets whether the drop-down casts a shadow. |
ShouldDrawVerticalResizeGripper | Gets or sets whether the resize strip shows grip marks for dragging the drop-down taller or shorter. |
ShouldRememberUserSizedDropDownSize | Gets or sets whether the drop-down reopens at the size the user last dragged it to. |
TextDisplayVisualBackColor | Gets or sets the background colour of the control's text field. |
TextDisplayVisualBorderColor | Gets or sets the colour of the border round the control's text field. |
TextDisplayVisualBorderThickness | Gets or sets the width of the border round the control's text field. |
TextDisplayVisualFont | Gets or sets the font the time is shown in, in the control's text field. |
TextDisplayVisualTextForeColor | Gets or sets the colour of the time in the control's text field. |
Properties
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
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
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
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
Gets or sets the colour of the grip marks on the drop-down's resize strip.
- Value
- The default is
Color.White.
DropDownResizeSectionBorderColor
Gets or sets the colour of the border round the drop-down's resize strip.
- Value
- The default is
Color.SlateGray.
DropDownResizeSectionFillColor
Gets or sets the colour of the resize strip along the bottom of the drop-down.
- Value
- The default is
Color.SlateGray.
DropDownSize
Gets or sets the size of the drop-down's column area.
- Value
- In logical pixels. The default is 227 by 110.
Size.Emptyopens 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
Gets or sets whether the user can resize the drop-down by dragging the strip along its bottom.
- Value
trueto allow it. The default istrue.
See also
PopupCommandVisualBorderColor
Gets or sets the colour of the drop-down button's border at rest.
- Value
- The default is
Color.Chocolate.
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
Gets or sets the colour of the drop-down button's border while it is pressed.
- Value
- The default is
Color.SlateGray.
PopupCommandVisualFont
Gets or sets the font of PopupCommandVisualText on the drop-down button.
- Value
- The default is Microsoft Sans Serif, 12 points.
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
Gets or sets the colour of the drop-down button while the pointer is over it.
- Value
- The default is
Color.DarkRed.
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
Gets or sets the colour of the drop-down button at rest.
- Value
- The default is
Color.Chocolate.
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
Gets or sets the colour of the drop-down button while it is pressed.
- Value
- The default is
Color.SlateGray.
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
Gets or sets whether a stretched button picture is kept in from the button's edges.
- Value
trueto draw it over about seven tenths of the button. The default isfalse.
Remarks
Used only while PopupCommandVisualMaximumInternalImageDrawingSize is Size.Empty.
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
Gets or sets the colour of PopupCommandVisualText on the drop-down button.
- Value
- The default is
SystemColors.WindowText.
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
Gets or sets whether the resize strip shows a corner grip for dragging the drop-down's width and height together.
- Value
trueto show it. The default istrue.
ShouldDrawDropDownResizeSectionWith3DBorder
Gets or sets whether the resize strip is drawn with a raised, 3D border rather than a flat one.
- Value
truefor the 3D border. The default isfalse.
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
Gets or sets whether the resize strip shows grip marks for dragging the drop-down taller or shorter.
- Value
trueto show them. The default istrue.
ShouldRememberUserSizedDropDownSize
Gets or sets whether the drop-down reopens at the size the user last dragged it to.
- Value
trueto remember the size. The default isfalse: it always opens atDropDownSize.
TextDisplayVisualBackColor
Gets or sets the background colour of the control's text field.
- Value
- The default is
SystemColors.Window.
TextDisplayVisualBorderColor
Gets or sets the colour of the border round the control's text field.
- Value
- The default is
Color.SlateGray.
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
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
Gets or sets the colour of the time in the control's text field.
- Value
- The default is
Color.SlateGray.