Class CustomTextBox
Base class for text editors.
[ControlCategory("Hidden")]
public abstract class CustomTextBox : Control, IBaseObject, IDisposableObject, ISupportInitialize, IFocusable, ITextProperty, IComponent, IControl, IWin32Window, ICustomTextBox, IDisposable, IReadOnlyStrings, IValidatorReporter, IObjectToStringOptions, INotifyDataErrorInfo
- Inheritance
-
CustomTextBox
- Implements
- Derived
Properties
- AllowEmptyText
Gets or sets a value indicating whether empty string is allowed in Text.
- Converter
Gets or sets IObjectToString provider which is used in value to string convertion.
- DefaultErrorBackgroundColor
Gets or sets default Color that can be used as a background color for the TextBox in cases when application needs to report user an error in Text property.
- DefaultErrorForegroundColor
Gets or sets default Color that can be used as a foreground color for the TextBox in cases when application needs to report user an error in Text property.
- DefaultErrorUseBackgroundColor
Gets or sets whether to use DefaultErrorBackgroundColor when application needs to report user an error.
- DefaultErrorUseForegroundColor
Gets or sets whether to use DefaultErrorForegroundColor when application needs to report user an error.
- DefaultFormat
Gets or sets default format used in value to string convertion.
- DefaultResetErrorBackgroundMethod
Gets or sets default value for the ResetErrorBackgroundMethod property.
- DefaultResetErrorForegroundMethod
Gets or sets default value for the ResetErrorForegroundMethod property.
- DefaultText
Gets or sets default value for the Text property.
- DefaultValidatorErrorText
Gets or sets a text string that can be used as a default validator error message.
- EmptyTextValue
Gets or sets data value in cases when Text property is empty.
- FormatProvider
Gets or sets an object that supplies culture-specific formatting information.
- HasErrors
Gets a value that indicates whether this control or its child controls have validation errors.
- IsNullOrEmpty
Gets whether Text is null or empty.
- IsNullOrWhiteSpace
Gets whether Text is null or white space.
- IsRequired
Gets or sets a value indicating whether Text is required to be not empty. This is an opposite of AllowEmptyText property.
- MaxLength
Gets or sets the maximum number of characters the user can enter into the control.
- MaxValue
Gets or sets the maximum value that can be entered in the control.
- MinLength
Gets or sets the minimum number of characters the user must enter into the control.
- MinValue
Gets or sets the minimum value that can be entered in the control.
- NumberStyles
Gets or sets a bitwise combination of NumberStyles values that indicates the permitted format of the text.
- Options
Gets or sets flags which customize behavior and visual style of the control.
- ResetErrorBackgroundMethod
Gets or sets method which is used to clear error state if error backround color is used for reporting it.
- ResetErrorForegroundMethod
Gets or sets method which is used to clear error state if error foreground color is used for reporting it.
- Search
Gets or sets string search provider.
- TextAsNumber
Gets or sets Text property value as object of a number type.
- ValidatorErrorText
Gets or sets a text string that can be used as validator error message.
- ValidatorReporter
Gets or sets validator reporter object or control.
Methods
- DataTypeIsNumber()
Returns
true
if DataType is a number type.
- GetErrors()
Gets the validation errors.
- GetErrors(string?)
Gets the validation errors for this control and its child controls.
- GetKnownErrorText(ValueValidatorKnownError)
Gets known error text.
- GetLineText(long)
Returns the contents of a given line in the text control, not including any trailing newline character(s).
- GetMinMaxRangeStr(string?)
Returns minimal and maximal possible values for the DataType as a range string and formats it using
format
.
- GetNumberOfLines()
Returns the number of lines in the text control buffer.
- GetRealMaxValue()
Gets "real" maxmimal value taking into account DataType and MinValue.
- GetRealMinValue()
Gets "real" minimal value taking into account DataType and MinValue.
- HasErrorEmptyText()
Gets 'Empty Text' error status if empty text is not allowed.
- HasErrorMaxLength()
Gets 'Max Length' error status if MaxLength is specified.
- HasErrorMinLength()
Gets 'Min Length' error status if MinLength is specified.
- InitErrorPicture(PictureBox)
Initializes PictureBox with error image and other options.
- ReportErrorBadNumber(Action<string>?)
Reports an error if DataType is a number type and TextAsNumber is
null
.
- ReportErrorEmptyText(Action<string>?)
Reports an error if Text property is empty and it is not allowed (AllowEmptyText is
false
).
- ReportErrorMinMaxLength(Action<string>?)
Reports an error if length of the Text property value is less than MinLength or greater than MaxLength.
- ReportErrorMinMaxValue(object?, Action<string>?)
Reports an error if
value
is less than MinValue or greater than MaxValue.
- ReportValidatorError(bool, string?, Action<string>?)
Reports text validation error.
- RunDefaultValidation(Action<string>?)
Runs default validation of the Text property.
- SetTextAsByte(byte)
Converts
value
to string and assigns Text property with the converted value.
- SetTextAsDateTime(DateTime)
Converts
value
to string and assigns Text property with the converted value.
- SetTextAsDecimal(decimal)
Converts
value
to string and assigns Text property with the converted value.
- SetTextAsDouble(double)
Converts
value
to string and assigns Text property with the converted value.
- SetTextAsInt16(short)
Converts
value
to string and assigns Text property with the converted value.
- SetTextAsInt32(int)
Converts
value
to string and assigns Text property with the converted value.
- SetTextAsInt64(long)
Converts
value
to string and assigns Text property with the converted value.
- SetTextAsObject(object?)
Converts
value
to string and assigns Text property with the converted value.
- SetTextAsSByte(sbyte)
Converts
value
to string and assigns Text property with the converted value.
- SetTextAsSingle(float)
Converts
value
to string and assigns Text property with the converted value.
- SetTextAsUInt16(ushort)
Converts
value
to string and assigns Text property with the converted value.
- SetTextAsUInt32(uint)
Converts
value
to string and assigns Text property with the converted value.
- SetTextAsUInt64(ulong)
Converts
value
to string and assigns Text property with the converted value.
- TextAsNumberOrDefault<T>(T)
Returns TextAsNumber or
defValue
if it isnull
.
Events
- ErrorStatusChanged
Occurs when ReportValidatorError(bool, string?, Action<string>?) is called.