BinaryExtendedText
BinaryExtendedText© .NET control is an advanced and "feature-rich text box" control for the WinForms .NET© platform.
public class BinaryExtendedText : System.Windows.Forms.TextBox
Inherits from / implements: System.Windows.Forms.TextBox
Remarks
The control supports a set of "feature rich" properties in order to provide a Windows XP© style look-and-feel "text box" control, with additional features, such as the ability to change the control's border color, special hovering effects as one can see in the Visual Studio .NET controls, and a cool "border blinking" alerting mechanism.
The control basically derives from the .NET TextBox control, does its own custom painting, and in addition exposes properties to set various of its states/behaviors.
For more information, please refer to the various properties, especially, the ShowBorderAlways, ExtendedState, and the BorderColor properties.
Members at a glance
BinaryExtendedText | Creates a new instance of the BinaryExtendedText .NET control. |
BorderColor | Gets or sets the border color of the control's borders. |
BorderColorWhenControlIsDisabled | Gets or sets the color to use to draw the control's border, when the control is disabled. |
BorderColorWhenControlIsNotInFocus | Gets or sets the color to use to draw the control's border, when the control is not in focus, and the control's ShowBorderAlways is not set to true. |
BorderStyle | — |
DotBorderDepth | Gets or sets the painting depth (length/width) of a dotted border. |
DotBorderGap | Gets or sets the painting gaps between the dots while drawing the dotted border for the control. |
DrawBorder | Gets or sets the border state of the control when drawing the control's border. |
ExtendedState | Gets or sets whether the control will be displayed in its Extended style mode or not. |
OptimiseRedrawWhenDisabled | Gets or sets a value indicating whether to optimise redrawing of Control's artefacts when disabled. |
ShowBorderAlways | Gets or sets whether the control will always have its border displayed, even when the control is not currently in focus. |
UseEnhancedPasswordChar | Gets or sets whether the "password" text will be displayed using the popular "XP-style", block dots fashion. |
OnGotFocus | — |
OnLostFocus | — |
OnMouseEnter | — |
OnMouseLeave | — |
StartToBlink | Blinks the control's border. This method takes a Color value and blinks the control's border. |
StartToBlink | Blinks the control's border. This method takes a Color value and a Timer interval, and blinks the control's border. |
StopBlinking | Stops blinking the control's border. |
WndProc | — |
Constructors
BinaryExtendedText
Creates a new instance of the BinaryExtendedText .NET control.
Properties
BorderColor
Gets or sets the border color of the control's borders.
This property will have effect only when the control's
ExtendedState property is set to true. Note: Changing this property will not have any effect if the control is currently being blinked.
By default, this property is set to
Highlight color value. BorderColorWhenControlIsDisabled
Gets or sets the color to use to draw the control's border, when the control is disabled.
Enabled property is set to false. This property will have effect only when the control's
ExtendedState property is set to true and its OptimiseRedrawWhenDisabled property is set to false. By default, this property is set to the
InactiveBorder color value, which preserves the control's traditional disabled appearance. On some Windows themes the InactiveBorder color is white (or very close to white), and therefore the disabled border may not be readily visible against the control's background. If you want the disabled border to remain visible, set this property to a suitable color - for example, to the same value as the BorderColor or the BorderColorWhenControlIsNotInFocus property. Note: This property affects the border color only. It does not change the disabled background or the disabled (grayed) text of the control.
BorderColorWhenControlIsNotInFocus
Gets or sets the color to use to draw the control's border, when the control is not in focus, and the control's ShowBorderAlways is not set to true.
BorderStyle
No summary in the source yet.
DotBorderDepth
Gets or sets the painting depth (length/width) of a dotted border.
DrawBorder property to "Dotted" (refer BorderState), the control is drawn with a dotted border. You can set the depth of each of the dotted border part by setting this property. This property determines the length/width of each of the dot, while drawing the border.
This property will have effect only when the control's
ExtendedState property is set to true. By default, this property is set to integer (int) value of 4. DotBorderGap
Gets or sets the painting gaps between the dots while drawing the dotted border for the control.
DrawBorder property to "Dotted" (refer BorderState), the control is drawn with a dotted border. You can set the gap between each of the dotted border part by setting this property. This property determines the length of gap between each dot, while drawing the border.
This property will have effect only when the control's
ExtendedState property is set to true. By default, this property is set to integer (int) value of 5. DrawBorder
Gets or sets the border state of the control when drawing the control's border.
ExtendedState mode. Basically, there are two different states available for drawing the control's border, while in
ExtendedState. - Normal border - This is a
BorderStatewhen the control's border is drawn using a continuous line. - Dotted border - This is a
BorderStatewhen the control's border is drawn as a dotted border.
If you want the control's border to be drawn as a dotted border, you should set this property to the appropriate value, viz., BinaryExtendedText.BorderState.Dotted.
If you want the control's border to be drawn as a regular non-dotted line, set this property to BinaryExtendedText.BorderState.Normal.
This property will have effect only when the control's
ExtendedState property is set to true. By default, this property is set to BinaryExtendedText.BorderState.Normal.
ExtendedState
Gets or sets whether the control will be displayed in its Extended style mode or not.
The control supports two different styles for its display, viz., Standard Windows 3D text box style and an "extended feature rich" style. You can switch between these two styles at any time by setting the control's
ExtendedState property. The "Extended" style provides for the following rich features :-
<font color="blue">1. Custom border color</font> - The control supports setting custom border color. By default, when the control is in the extended style mode, its borders are drawn using the
Highlight color. You can set a different color for drawing the control's border, by setting its BorderColor property. <font color="blue">2. Custom Border styles</font> - The control supports two different border styles - Normal and Dotted.
By setting the
DrawBorder property to Dotted style, you can have the control's border drawn as a dotted line. Refer
DrawBorder property for more details about this feature. <font color="blue">3. Mouse hovering effects</font> - While in extended style mode and when the input focus is not on the control, whenever the mouse focus moves over and out of the control, the control's borders are drawn and cleared respectively, giving a "Visual Studio .NET style" control hovering effects.
To change this default behavior, you can set the control's
ShowBorderAlways property to true, if you want the control's border to be displayed irrespective of whether the control has input focus or otherwise. OptimiseRedrawWhenDisabled
Gets or sets a value indicating whether to optimise redrawing of Control's artefacts when disabled.
Value. true if the Control should optimise redrawing when in disabled state; otherwise, false .
ShowBorderAlways
Gets or sets whether the control will always have its border displayed, even when the control is not currently in focus.
This property will have effect only when the control's
ExtendedState property is set to true. By default, this property is set to false.
UseEnhancedPasswordChar
Gets or sets whether the "password" text will be displayed using the popular "XP-style", block dots fashion.
Set this property to true, to display the password text using the enhanced "XP-style" block dots.
Once you set this property to true, any further changes to the
PasswordChar property is completely ignored! And hence, whenever you restate this property to false (from an earlier state of true), ensure that you re-set the
PasswordChar property again with your custom password character. Setting this property to false, displays password text using the normal user specified
PasswordChar character. By default, this property is set to false.
Methods
OnGotFocus
No summary in the source yet.
- e
OnLostFocus
No summary in the source yet.
- e
OnMouseEnter
No summary in the source yet.
- e
OnMouseLeave
No summary in the source yet.
- e
StartToBlink
Blinks the control's border. This method takes a Color value and blinks the control's border.
- BlinkColor
- A
Colorvalue.
BorderColor with the given Color parameter. Since this method does not take a timer interval value as a parameter, it sets its internal timer interval to a default value of 500 milliseconds, to perform the repetitive blinks.
Note: This method will have effect only when the control is in its
ExtendedState mode and its Enabled property is set to true. Also note that any changes made to the control's property
ShowBorderAlways after calling the method StartToBlink, will be ignored! StartToBlink
Blinks the control's border. This method takes a Color value and a Timer interval, and blinks the control's border.
- BlinkColor
- A
Colorvalue. - BlinkInterval
- An integer value specifying a timer interval (in milliseconds).
BorderColor with the given Color parameter. Since this method takes a timer interval value as a parameter, it uses this value to set its internal timer interval to perform the repetitive blinks.
Note: This method will have effect only when the control is in its
ExtendedState mode and its Enabled property is set to true. Also note that any changes made to the control's property
ShowBorderAlways after calling the method StartToBlink, will be ignored! StopBlinking
Stops blinking the control's border.
Remember, this method will have effect only when the control's
ExtendedState property is set to true and the control is currently Enabled. Whenever you need to set the properties
ExtendedState or Enabled to false, ensure to call this method, if the control is currently being blinked, as otherwise, the control will continue to blink when these states (ExtendedState or Enabled) are reset to true at a later stage. WndProc
No summary in the source yet.
- m