HypernovaDesktop Components · docs
Binarymission
WinFormsSearch Text Box › SearchTextBox

SearchTextBox

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

A custom text box control that provides text hosting and also three embedded objects inside the control for commanding/custom action.

public class SearchTextBox : BinaryExtendedText

Inherits from / implements: BinaryExtendedText

Remarks


The control does everything a regular text box does. In addition, it has the following capabilities:

1. All extended text box features provided by our ExtendedTextBox control (i.e. BinaryExtendedText class) from our WinForms controls toolkit
2. Supports Cue text/banner text for displaying a watermark / placeholder text (with dimmed gray text fore color) while the user is yet to type any text in to the control
3. The Cue text/watermark/banner text is customizable
4. The control supports hosting 3 embedded visual objects inside the control, each representing a command invoker, in order to execute a particular functionality / command logic, viz., Search, Clear text, and an artifact to enable attaching a object to perform more commands on the control.

The control exposes several properties to customize the control's visual appearance, and also exposes three specific custom events (on text search request, clearing search text request and an options list drop-down request) to let your application handle them as deemed fit.

Members at a glance

SearchTextBoxInitializes a new instance of the SearchTextBox class.
ClearSearchTextCommandInvokerImageGets or sets the clear search text command invoker image.
CueTextGets or sets the cue/banner text.
DefaultDropListChevronBorderColorGets or sets the color of the default drop-list chevron border.
DefaultDropListChevronBorderOnHoverColorGets or sets the color of the default drop-list chevron's border, upon hovering.
DefaultDropListChevronBorderWidthGets or sets the width of the default drop-list chevron border.
DefaultDropListChevronRotateFlipTypeGets or sets the rotate flip type of the default drop-list chevron.
HoverColorForSearchDropListChevronGets or sets the hover color for search list drop down chevron.
IsCueTextRenderedWhenInFocusGets or sets a value indicating whether the control should render cue/banner text even when the control is in focus.
IsOnlyWatermarkProviderGets or sets whether the control enables the full search and extended events facilities, or is to simply render as a watermark text control.
IsSearchCommandSetEnabledGets or sets a value indicating whether the control will provide search commands/events and render their respective visuals.
IsSearchDropListOpenRequestCompletedGets or sets whether the search drop-list open request has been completed/handled.
MarginBetweenTextAndCommandInvokersGets or sets the margin between text and command invokers.
MultilineGets a value indicating whether this is a multi-line TextBox control.
NormalColorForSearchDropListChevronGets or sets the normal color for search list drop down chevron.
ScrollBarsGets or sets which scroll bars should appear this control.
SearchCommandInvokerImageGets or sets the search command invoker image.
SearchDropListCommandChevronFillColorGets or sets the fill color of the search drop-list command chevron.
SearchDropListCommandInvokerImageGets or sets the search drop-list command invoker image.
OnDpiChangedAfterParentRebuilds the generated command glyphs when the box moves to a display with a different scale factor.
OnFontChangedRaises the FontChanged event. SearchTextBox overrides it so the control's own handling runs alongside the base behavior.
OnParentChangedRaises the ParentChanged event. SearchTextBox overrides it so the control's own handling runs alongside the base behavior.
OnParentFontChangedRaises the ParentFontChanged event. SearchTextBox overrides it so the control's own handling runs alongside the base behavior.
OnResizeRaises the Resize event. SearchTextBox overrides it so the control's own handling runs alongside the base behavior.
RefreshControlBlinkPerforms control border blinking feature.
ClearSearchTextRequestedOccurs when a clear search text is requested.
SearchDropListOpenRequestedOccurs when a search drop-list opening is requested.
TextSearchRequestedOccurs when a text search is requested.

Constructors

SearchTextBox

public SearchTextBox()

Initializes a new instance of the SearchTextBox class.

Properties

ClearSearchTextCommandInvokerImage

public Image ClearSearchTextCommandInvokerImage

Gets or sets the clear search text command invoker image.

CueText

public string CueText

Gets or sets the cue/banner text.

DefaultDropListChevronBorderColor

public Color DefaultDropListChevronBorderColor

Gets or sets the color of the default drop-list chevron border.

DefaultDropListChevronBorderOnHoverColor

public Color DefaultDropListChevronBorderOnHoverColor

Gets or sets the color of the default drop-list chevron's border, upon hovering.

DefaultDropListChevronBorderWidth

public float DefaultDropListChevronBorderWidth

Gets or sets the width of the default drop-list chevron border.

DefaultDropListChevronRotateFlipType

public RotateFlipType DefaultDropListChevronRotateFlipType

Gets or sets the rotate flip type of the default drop-list chevron.

HoverColorForSearchDropListChevron

public Color HoverColorForSearchDropListChevron

Gets or sets the hover color for search list drop down chevron.

IsCueTextRenderedWhenInFocus

public bool IsCueTextRenderedWhenInFocus

Gets or sets a value indicating whether the control should render cue/banner text even when the control is in focus.

IsOnlyWatermarkProvider

public bool IsOnlyWatermarkProvider

Gets or sets whether the control enables the full search and extended events facilities, or is to simply render as a watermark text control.

IsSearchCommandSetEnabled

public bool IsSearchCommandSetEnabled

Gets or sets a value indicating whether the control will provide search commands/events and render their respective visuals.

When the property is set to true, all three capabilities are enabled - i.e. search event, clear text event and the drop-list invoked event.
When the property is set to false, the search related visuals and capabilities, i.e. the search and clear search related events, are not enabled, but it will still render the drop-list command and its visual for any other generic use.

IsSearchDropListOpenRequestCompleted

public bool IsSearchDropListOpenRequestCompleted

Gets or sets whether the search drop-list open request has been completed/handled.

MarginBetweenTextAndCommandInvokers

public int MarginBetweenTextAndCommandInvokers

Gets or sets the margin between text and command invokers.

Value. The margin between text and command invokers.

Multiline

public new bool Multiline

Gets a value indicating whether this is a multi-line TextBox control.

The control does not support multi-line text rendering.

NormalColorForSearchDropListChevron

public Color NormalColorForSearchDropListChevron

Gets or sets the normal color for search list drop down chevron.

ScrollBars

public new ScrollBars ScrollBars

Gets or sets which scroll bars should appear this control.

The control does not support scrollbars rendering.

SearchCommandInvokerImage

public Image SearchCommandInvokerImage

Gets or sets the search command invoker image.

SearchDropListCommandChevronFillColor

public Color SearchDropListCommandChevronFillColor

Gets or sets the fill color of the search drop-list command chevron.

SearchDropListCommandInvokerImage

public Image SearchDropListCommandInvokerImage

Gets or sets the search drop-list command invoker image.

Methods

OnDpiChangedAfterParent

protected override void OnDpiChangedAfterParent(EventArgs e)

Rebuilds the generated command glyphs when the box moves to a display with a different scale factor.

e
The event data.

OnFontChanged

protected override void OnFontChanged(EventArgs e)

Raises the FontChanged event. SearchTextBox overrides it so the control's own handling runs alongside the base behavior.

e
The data for the event.

OnParentChanged

protected override void OnParentChanged(EventArgs e)

Raises the ParentChanged event. SearchTextBox overrides it so the control's own handling runs alongside the base behavior.

e
The data for the event.

OnParentFontChanged

protected override void OnParentFontChanged(EventArgs e)

Raises the ParentFontChanged event. SearchTextBox overrides it so the control's own handling runs alongside the base behavior.

e
The data for the event.

OnResize

protected override void OnResize(EventArgs e)

Raises the Resize event. SearchTextBox overrides it so the control's own handling runs alongside the base behavior.

e
The data for the event.

Events

ClearSearchTextRequested

public event EventHandler ClearSearchTextRequested

Occurs when a clear search text is requested.

SearchDropListOpenRequested

public event EventHandler<SearchTextBoxDropListInvokedEventArgs> SearchDropListOpenRequested

Occurs when a search drop-list opening is requested.

TextSearchRequested

public event EventHandler<SearchTextBoxRequestEventArgs> TextSearchRequested

Occurs when a text search is requested.