Class
RadTextBoxControl

Represents a text box control that enables users to enter and edit text with support for multiline editing, auto-completion, and advanced text manipulation features. This control serves as a wrapper around RadTextBoxControlElement and provides comprehensive text input functionality including password masking, scrolling, and data binding capabilities.

Definition

Namespace:Telerik.WinControls.UI

Assembly:Telerik.WinControls.UI.dll

Syntax:

cs-api-definition
[TelerikToolboxCategory("Editors")]
[DefaultBindingProperty("Text")]
[ClassInterface(ClassInterfaceType.AutoDispatch)]
[ComVisible(true)]
public class RadTextBoxControl : RadControl, IDropTarget, ISynchronizeInvoke, IWin32Window, IBindableComponent, IComponent, IDisposable, INotifyPropertyChanged, ISupportInitializeNotification, ISupportInitialize, IComponentTreeHandler, ILayoutHandler, IAnalyticsProvider

Inheritance: objectMarshalByRefObjectComponentControlScrollableControlRadControlRadTextBoxControl

Derived Classes: RadAutoCompleteBox

Implements: IAnalyticsProviderIBindableComponentIComponentIComponentTreeHandlerIDisposableIDropTargetILayoutHandlerINotifyPropertyChangedISupportInitializeISupportInitializeNotificationISynchronizeInvokeIWin32Window

Inherited Members RadControl.isResizing2RadControl.isDisposing2RadControl.invalidResizeRectRadControl.isAccessibilityRequestedRadControl.Dispose(bool)RadControl.Construct()RadControl.CreateBehavior()RadControl.CreateRootElement()RadControl.InitializeRootElement(RootRadElement)RadControl.LoadElementTree()RadControl.LoadElementTree(Size)RadControl.OnKeyDown(KeyEventArgs)RadControl.OnKeyUp(KeyEventArgs)RadControl.OnPreviewKeyDown(PreviewKeyDownEventArgs)RadControl.OnClick(EventArgs)RadControl.OnDoubleClick(EventArgs)RadControl.OnMouseDown(MouseEventArgs)RadControl.OnMouseUp(MouseEventArgs)RadControl.OnMouseEnter(EventArgs)RadControl.OnMouseLeave(EventArgs)RadControl.OnMouseMove(MouseEventArgs)RadControl.OnMouseHover(EventArgs)RadControl.OnMouseWheel(MouseEventArgs)RadControl.OnMouseCaptureChanged(EventArgs)RadControl.OnCreateControl()RadControl.OnHandleDestroyed(EventArgs)RadControl.OnParentChanged(EventArgs)RadControl.OnVisibleChanged(EventArgs)RadControl.OnFontChanged(EventArgs)RadControl.OnForeColorChanged(EventArgs)RadControl.OnBackColorChanged(EventArgs)RadControl.OnEnabledChanged(EventArgs)RadControl.OnBindingContextChanged(EventArgs)RadControl.OnLocationChanged(EventArgs)RadControl.OnPaddingChanged(EventArgs)RadControl.OnRightToLeftChanged(EventArgs)RadControl.OnPaint(PaintEventArgs)RadControl.OnLayout(LayoutEventArgs)RadControl.OnAutoSizeChanged(EventArgs)RadControl.WndProc(ref Message)RadControl.OnInvalidated(RadElement)RadControl.OnCaptureLosing()RadControl.OnThemeChanged()RadControl.OnToolTipTextNeeded(object, ToolTipTextNeededEventArgs)RadControl.OnScreenTipNeeded(object, ScreenTipNeededEventArgs)RadControl.OnThemeNameChanged(ThemeNameChangedEventArgs)RadControl.ProcessFocusRequested(RadElement)RadControl.ProcessCaptureChangeRequested(RadElement, bool)RadControl.IsInputKey(Keys)RadControl.GetInputElement()RadControl.BeginInit()RadControl.EndInit()RadControl.OnNotifyPropertyChanged(string)RadControl.OnNotifyPropertyChanged(PropertyChangedEventArgs)RadControl.GetPreferredSize(Size)RadControl.SetBoundsCore(int, int, int, int, BoundsSpecified)RadControl.GetRootElementDesiredSize(int, int, int, int)RadControl.OnZoomGesture(ZoomGestureEventArgs)RadControl.OnRotateGesture(RotateGestureEventArgs)RadControl.OnPanGesture(PanGestureEventArgs)RadControl.OnTwoFingerTapGesture(GestureEventArgs)RadControl.OnPressAndTapGesture(PressAndTapGestureEventArgs)RadControl.OnGesture(GestureEventArgs)RadControl.ProcessGesture(Message)RadControl.EnableGesture(GestureType)RadControl.DisableGesture(GestureType)RadControl.Refresh()RadControl.SuspendUpdate()RadControl.ResumeUpdate()RadControl.ResumeUpdate(bool)RadControl.InvokeLayoutCallback(LayoutCallback)RadControl.RegisterHostedControl(RadHostItem)RadControl.UnregisterHostedControl(RadHostItem, bool)RadControl.ResolveStyleGroupForElement(StyleGroup, RadObject)RadControl.GetPlainText()RadControl.ShouldSerializeProperty(RadProperty)RadControl.ShouldSerializeProperty(RadProperty, RadObject)RadControl.ResetProperty(RadProperty, RadObject)RadControl.CanEditElementAtDesignTime(RadElement)RadControl.ProcessCodedUIMessage(ref IPCMessage)RadControl.FindPropertyInChildren(RadControl, IPCMessage)RadControl.ScaleControl(SizeF, BoundsSpecified)RadControl.PerformRadAutoScale(BoundsSpecified?)RadControl.GetMonitorDpiScaleFactor(Control)RadControl.SetRadAutoScale(bool)RadControl.EnableDpiScalingRadControl.EnableRadAutoScaleRadControl.EnableRadFormInitialDpiScalingRadControl.EnableImageDpiScalingRadControl.EnableSvgImagesRadControl.IsLoadedRadControl.ElementTreeRadControl.UseCompatibleTextRenderingDefaultValueRadControl.BehaviorRadControl.RootElementRadControl.PaddingRadControl.ThemeNameRadControl.EnableThemingRadControl.ThemeClassNameRadControl.ImageListRadControl.ImageScalingSizeRadControl.UseCompatibleTextRenderingRadControl.MaximumSizeRadControl.MinimumSizeRadControl.FocusableRadControl.SiteRadControl.CausesValidationRadControl.IsInitializingRadControl.SmallImageListRadControl.SmallImageScalingSizeRadControl.IsDesignModeRadControl.IsDisplayedRadControl.FocusedElementRadControl.AllowShowFocusCuesRadControl.ShowItemToolTipsRadControl.CommandBindingsRadControl.EnableKeyMapRadControl.BackColorRadControl.ForeColorRadControl.FontRadControl.ValidationCancelRadControl.EnableAnalyticsRadControl.AnalyticsNameRadControl.EnableRadAccessibilityObjectsRadControl.EnableCodedUITestsRadControl.EnableCodedUITestsDefaultValueRadControl.EnableUIAutomationRadControl.EnableUIAutomationDefaultValueRadControl.ElementInvalidatedRadControl.ToolTipTextNeededRadControl.ScreenTipNeededRadControl.ThemeNameChangedRadControl.InitializedRadControl.PropertyChangedRadControl.ZoomGestureRadControl.RotateGestureRadControl.PanGestureRadControl.TwoFingerTapGestureRadControl.PressAndTapGestureScrollableControl.ScrollStateAutoScrollingScrollableControl.ScrollStateHScrollVisibleScrollableControl.ScrollStateVScrollVisibleScrollableControl.ScrollStateUserHasScrolledScrollableControl.ScrollStateFullDragScrollableControl.AdjustFormScrollbars(bool)ScrollableControl.GetScrollState(int)ScrollableControl.OnPaintBackground(PaintEventArgs)ScrollableControl.SetDisplayRectLocation(int, int)ScrollableControl.ScrollControlIntoView(Control)ScrollableControl.ScrollToControl(Control)ScrollableControl.OnScroll(ScrollEventArgs)ScrollableControl.SetAutoScrollMargin(int, int)ScrollableControl.SetScrollState(int, bool)ScrollableControl.AutoScrollScrollableControl.AutoScrollMarginScrollableControl.AutoScrollPositionScrollableControl.AutoScrollMinSizeScrollableControl.CreateParamsScrollableControl.DisplayRectangleScrollableControl.HScrollScrollableControl.HorizontalScrollScrollableControl.VScrollScrollableControl.VerticalScrollScrollableControl.ScrollControl.GetAccessibilityObjectById(int)Control.SetAutoSizeMode(AutoSizeMode)Control.GetAutoSizeMode()Control.AccessibilityNotifyClients(AccessibleEvents, int)Control.AccessibilityNotifyClients(AccessibleEvents, int, int)Control.BeginInvoke(Delegate)Control.BeginInvoke(Delegate, params object[])Control.BringToFront()Control.Contains(Control)Control.CreateControlsInstance()Control.CreateGraphics()Control.CreateHandle()Control.CreateControl()Control.DefWndProc(ref Message)Control.DestroyHandle()Control.DoDragDrop(object, DragDropEffects)Control.DrawToBitmap(Bitmap, Rectangle)Control.EndInvoke(IAsyncResult)Control.FindForm()Control.GetTopLevel()Control.RaiseKeyEvent(object, KeyEventArgs)Control.RaiseMouseEvent(object, MouseEventArgs)Control.Focus()Control.FromChildHandle(IntPtr)Control.FromHandle(IntPtr)Control.GetChildAtPoint(Point, GetChildAtPointSkip)Control.GetChildAtPoint(Point)Control.GetContainerControl()Control.GetScaledBounds(Rectangle, SizeF, BoundsSpecified)Control.GetNextControl(Control, bool)Control.GetStyle(ControlStyles)Control.Hide()Control.InitLayout()Control.Invalidate(Region)Control.Invalidate(Region, bool)Control.Invalidate()Control.Invalidate(bool)Control.Invalidate(Rectangle)Control.Invalidate(Rectangle, bool)Control.Invoke(Delegate)Control.Invoke(Delegate, params object[])Control.InvokePaint(Control, PaintEventArgs)Control.InvokePaintBackground(Control, PaintEventArgs)Control.IsKeyLocked(Keys)Control.IsInputChar(char)Control.IsMnemonic(char, string)Control.LogicalToDeviceUnits(int)Control.LogicalToDeviceUnits(Size)Control.ScaleBitmapLogicalToDevice(ref Bitmap)Control.NotifyInvalidate(Rectangle)Control.InvokeOnClick(Control, EventArgs)Control.OnBackgroundImageChanged(EventArgs)Control.OnBackgroundImageLayoutChanged(EventArgs)Control.OnCausesValidationChanged(EventArgs)Control.OnContextMenuChanged(EventArgs)Control.OnContextMenuStripChanged(EventArgs)Control.OnCursorChanged(EventArgs)Control.OnDockChanged(EventArgs)Control.OnNotifyMessage(Message)Control.OnParentBackColorChanged(EventArgs)Control.OnParentBackgroundImageChanged(EventArgs)Control.OnParentBindingContextChanged(EventArgs)Control.OnParentCursorChanged(EventArgs)Control.OnParentEnabledChanged(EventArgs)Control.OnParentFontChanged(EventArgs)Control.OnParentForeColorChanged(EventArgs)Control.OnParentRightToLeftChanged(EventArgs)Control.OnParentVisibleChanged(EventArgs)Control.OnPrint(PaintEventArgs)Control.OnTabIndexChanged(EventArgs)Control.OnTabStopChanged(EventArgs)Control.OnTextChanged(EventArgs)Control.OnClientSizeChanged(EventArgs)Control.OnControlAdded(ControlEventArgs)Control.OnControlRemoved(ControlEventArgs)Control.OnHandleCreated(EventArgs)Control.OnDragEnter(DragEventArgs)Control.OnDragOver(DragEventArgs)Control.OnDragLeave(EventArgs)Control.OnDragDrop(DragEventArgs)Control.OnGiveFeedback(GiveFeedbackEventArgs)Control.OnEnter(EventArgs)Control.InvokeGotFocus(Control, EventArgs)Control.OnHelpRequested(HelpEventArgs)Control.OnInvalidated(InvalidateEventArgs)Control.OnLeave(EventArgs)Control.InvokeLostFocus(Control, EventArgs)Control.OnMarginChanged(EventArgs)Control.OnMouseDoubleClick(MouseEventArgs)Control.OnMouseClick(MouseEventArgs)Control.OnDpiChangedBeforeParent(EventArgs)Control.OnDpiChangedAfterParent(EventArgs)Control.OnMove(EventArgs)Control.OnQueryContinueDrag(QueryContinueDragEventArgs)Control.OnRegionChanged(EventArgs)Control.OnResize(EventArgs)Control.OnSizeChanged(EventArgs)Control.OnChangeUICues(UICuesEventArgs)Control.OnStyleChanged(EventArgs)Control.OnSystemColorsChanged(EventArgs)Control.OnValidating(CancelEventArgs)Control.OnValidated(EventArgs)Control.RescaleConstantsForDpi(int, int)Control.PerformLayout()Control.PerformLayout(Control, string)Control.PointToClient(Point)Control.PointToScreen(Point)Control.PreProcessMessage(ref Message)Control.PreProcessControlMessage(ref Message)Control.ProcessCmdKey(ref Message, Keys)Control.ProcessDialogKey(Keys)Control.ProcessKeyEventArgs(ref Message)Control.ProcessKeyMessage(ref Message)Control.ProcessKeyPreview(ref Message)Control.RaiseDragEvent(object, DragEventArgs)Control.RaisePaintEvent(object, PaintEventArgs)Control.RecreateHandle()Control.RectangleToClient(Rectangle)Control.RectangleToScreen(Rectangle)Control.ReflectMessage(IntPtr, ref Message)Control.ResetMouseEventArgs()Control.ResetText()Control.ResumeLayout()Control.ResumeLayout(bool)Control.Scale(SizeF)Control.Select()Control.Select(bool, bool)Control.SelectNextControl(Control, bool, bool, bool, bool)Control.SendToBack()Control.SetBounds(int, int, int, int)Control.SetBounds(int, int, int, int, BoundsSpecified)Control.SetClientSizeCore(int, int)Control.SizeFromClientSize(Size)Control.SetStyle(ControlStyles, bool)Control.SetTopLevel(bool)Control.SetVisibleCore(bool)Control.RtlTranslateAlignment(HorizontalAlignment)Control.RtlTranslateAlignment(LeftRightAlignment)Control.RtlTranslateAlignment(ContentAlignment)Control.RtlTranslateHorizontal(HorizontalAlignment)Control.RtlTranslateLeftRight(LeftRightAlignment)Control.RtlTranslateContent(ContentAlignment)Control.Show()Control.SuspendLayout()Control.Update()Control.UpdateBounds()Control.UpdateBounds(int, int, int, int)Control.UpdateBounds(int, int, int, int, int, int)Control.UpdateZOrder()Control.UpdateStyles()Control.OnImeModeChanged(EventArgs)Control.AccessibilityObjectControl.AccessibleDefaultActionDescriptionControl.AccessibleDescriptionControl.AccessibleNameControl.AccessibleRoleControl.AllowDropControl.AnchorControl.AutoScrollOffsetControl.LayoutEngineControl.BackgroundImageControl.BackgroundImageLayoutControl.BindingContextControl.BottomControl.BoundsControl.CanFocusControl.CanRaiseEventsControl.CanSelectControl.CaptureControl.CheckForIllegalCrossThreadCallsControl.ClientRectangleControl.ClientSizeControl.CompanyNameControl.ContainsFocusControl.ContextMenuControl.ContextMenuStripControl.ControlsControl.CreatedControl.CursorControl.DataBindingsControl.DefaultBackColorControl.DefaultCursorControl.DefaultFontControl.DefaultForeColorControl.DefaultMarginControl.DefaultMaximumSizeControl.DefaultMinimumSizeControl.DefaultPaddingControl.DeviceDpiControl.IsDisposedControl.DisposingControl.DockControl.DoubleBufferedControl.EnabledControl.FocusedControl.FontHeightControl.HandleControl.HasChildrenControl.HeightControl.IsHandleCreatedControl.InvokeRequiredControl.IsAccessibleControl.IsMirroredControl.LeftControl.LocationControl.MarginControl.ModifierKeysControl.MouseButtonsControl.MousePositionControl.NameControl.ParentControl.ProductNameControl.ProductVersionControl.RecreatingHandleControl.RegionControl.RenderRightToLeftControl.ResizeRedrawControl.RightControl.RightToLeftControl.ScaleChildrenControl.SizeControl.TabIndexControl.TabStopControl.TagControl.TopControl.TopLevelControlControl.ShowKeyboardCuesControl.ShowFocusCuesControl.UseWaitCursorControl.VisibleControl.WidthControl.PreferredSizeControl.CanEnableImeControl.DefaultImeModeControl.ImeModeControl.ImeModeBaseControl.PropagatingImeModeControl.BackColorChangedControl.BackgroundImageChangedControl.BackgroundImageLayoutChangedControl.BindingContextChangedControl.CausesValidationChangedControl.ClientSizeChangedControl.ContextMenuChangedControl.ContextMenuStripChangedControl.CursorChangedControl.DockChangedControl.EnabledChangedControl.FontChangedControl.ForeColorChangedControl.LocationChangedControl.MarginChangedControl.RegionChangedControl.RightToLeftChangedControl.SizeChangedControl.TabIndexChangedControl.TabStopChangedControl.TextChangedControl.VisibleChangedControl.ClickControl.ControlAddedControl.ControlRemovedControl.DragDropControl.DragEnterControl.DragOverControl.DragLeaveControl.GiveFeedbackControl.HandleCreatedControl.HandleDestroyedControl.HelpRequestedControl.InvalidatedControl.PaddingChangedControl.PaintControl.QueryContinueDragControl.QueryAccessibilityHelpControl.DoubleClickControl.EnterControl.GotFocusControl.KeyDownControl.KeyPressControl.KeyUpControl.LayoutControl.LeaveControl.LostFocusControl.MouseClickControl.MouseDoubleClickControl.MouseCaptureChangedControl.MouseDownControl.MouseEnterControl.MouseLeaveControl.DpiChangedBeforeParentControl.DpiChangedAfterParentControl.MouseHoverControl.MouseMoveControl.MouseUpControl.MouseWheelControl.MoveControl.PreviewKeyDownControl.ResizeControl.ChangeUICuesControl.StyleChangedControl.SystemColorsChangedControl.ValidatingControl.ValidatedControl.ParentChangedControl.ImeModeChangedComponent.Dispose()Component.GetService(Type)Component.ToString()Component.EventsComponent.ContainerComponent.DesignModeComponent.DisposedMarshalByRefObject.MemberwiseClone(bool)MarshalByRefObject.GetLifetimeService()MarshalByRefObject.InitializeLifetimeService()MarshalByRefObject.CreateObjRef(Type)

Constructors

RadTextBoxControl()

Initializes a new instance of the RadTextBoxControl class. Sets up the control styles and registers the initialization event handler for deferred property setting.

Declaration

cs-api-definition
public RadTextBoxControl()

Properties

AcceptsReturn

Gets or sets a value indicating whether pressing ENTER creates a new line instead of activating the default button. When true in a multiline text box, ENTER keypresses create new lines; when false, they activate the form's default button.

Declaration

cs-api-definition
public bool AcceptsReturn { get; set; }

Property Value

bool

AcceptsTab

Gets or sets a value indicating whether pressing the TAB key inserts a tab character instead of moving focus. When true in a multiline text box, TAB keypresses insert tab characters; when false, they move focus to the next control.

Declaration

cs-api-definition
public bool AcceptsTab { get; set; }

Property Value

bool

AutoCompleteDataSource

Gets or sets the data source that provides auto-complete suggestions. This property specifies the collection or data source used to populate auto-complete items for text suggestions.

Declaration

cs-api-definition
[Browsable(true)]
public object AutoCompleteDataSource { get; set; }

Property Value

object

AutoCompleteDisplayMember

Gets or sets the property name to use as the display member for auto-complete items. This property determines which field from the AutoCompleteDataSource is displayed as suggestion text.

Declaration

cs-api-definition
[TypeConverter("System.Windows.Forms.Design.DataMemberFieldConverter, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
[Browsable(true)]
public string AutoCompleteDisplayMember { get; set; }

Property Value

string

AutoCompleteItems

Gets the collection of auto-complete items used for text suggestions. This property provides direct access to the items collection for adding, removing, or modifying suggestion entries.

Declaration

cs-api-definition
[Browsable(true)]
public RadListDataItemCollection AutoCompleteItems { get; }

Property Value

RadListDataItemCollection

AutoCompleteMode

Gets or sets the auto-completion mode that controls how automatic text completion works. This property determines whether suggestions are displayed in a dropdown, appended to the text, or both.

Declaration

cs-api-definition
public virtual AutoCompleteMode AutoCompleteMode { get; set; }

Property Value

AutoCompleteMode

AutoSize

Gets or sets a value indicating whether the control automatically resizes its height to display all content. For RadTextBoxControl, AutoSize affects only the height dimension and adjusts based on font size and content.

Declaration

cs-api-definition
[Browsable(true)]
public override bool AutoSize { get; set; }

Property Value

bool

Overrides RadControl.AutoSize

CaretIndex

Gets or sets the position of the text cursor (caret) within the text. This property represents the zero-based index of the character position where text insertion occurs.

Declaration

cs-api-definition
[Browsable(false)]
public int CaretIndex { get; set; }

Property Value

int

CharacterCasing

Gets or sets how the case of typed characters is modified automatically. This property allows forcing text to uppercase, lowercase, or preserving the original case as typed.

Declaration

cs-api-definition
public CharacterCasing CharacterCasing { get; set; }

Property Value

CharacterCasing

DefaultSize

Gets the default size of the text box control.

Declaration

cs-api-definition
protected override Size DefaultSize { get; }

Property Value

Size

A Size structure representing the default dimensions of the control (125x22 pixels).

Overrides Control.DefaultSize

DropDownMaxSize

Gets or sets the maximum size of the auto-complete dropdown list. This property controls the largest allowable dimensions for the dropdown that displays auto-complete suggestions.

Declaration

cs-api-definition
[Browsable(false)]
public Size DropDownMaxSize { get; set; }

Property Value

Size

DropDownMinSize

Gets or sets the minimum size of the auto-complete dropdown list. This property controls the smallest allowable dimensions for the dropdown that displays auto-complete suggestions.

Declaration

cs-api-definition
[Browsable(false)]
public Size DropDownMinSize { get; set; }

Property Value

Size

EmbeddedLabelText

Gets or sets the text displayed in the embedded label. This property controls the content of the label that appears when ShowEmbeddedLabel is enabled.

Declaration

cs-api-definition
public string EmbeddedLabelText { get; set; }

Property Value

string

HideSelection

Gets or sets a value indicating whether selected text remains highlighted when the control loses focus. When true, selected text highlighting is hidden when focus moves away from the control; when false, selection remains visible.

Declaration

cs-api-definition
public bool HideSelection { get; set; }

Property Value

bool

HorizontalScrollBarState

Gets or sets when the horizontal scroll bar should appear in a multiline text box. This property controls the visibility behavior of the horizontal scrollbar based on content overflow.

Declaration

cs-api-definition
public ScrollState HorizontalScrollBarState { get; set; }

Property Value

ScrollState

IsReadOnly

Gets or sets a value indicating whether the text box is in read-only mode, preventing user text modification. When true, users can select and copy text but cannot edit the content; when false, full editing is allowed.

Declaration

cs-api-definition
public bool IsReadOnly { get; set; }

Property Value

bool

IsReadOnlyCaretVisible

Gets or sets a value indicating whether the text cursor is visible when the control is in read-only mode. When true, the caret remains visible in read-only mode; when false, no cursor is shown.

Declaration

cs-api-definition
public bool IsReadOnlyCaretVisible { get; set; }

Property Value

bool

Lines

Gets or sets the lines of text in the text box as an array of strings. Each array element represents a separate line, allowing programmatic access to multiline text content.

Declaration

cs-api-definition
public string[] Lines { get; set; }

Property Value

string[]

ListElement

Gets the auto-complete list element that displays suggestion items. This property provides access to the dropdown list that shows auto-complete suggestions to the user.

Declaration

cs-api-definition
[Browsable(false)]
public RadTextBoxListElement ListElement { get; }

Property Value

RadTextBoxListElement

MaxDropDownItemCount

Gets or sets the maximum number of visible items in the auto-complete dropdown list. This property determines how many suggestion items are displayed simultaneously before scrolling is required.

Declaration

cs-api-definition
public int MaxDropDownItemCount { get; set; }

Property Value

int

MaxLength

Gets or sets the maximum number of characters that can be entered or pasted into the text box. When set to a value other than MaxValue, input is limited to this character count.

Declaration

cs-api-definition
public int MaxLength { get; set; }

Property Value

int

Multiline

Gets or sets a value indicating whether the text box supports multiple lines of text. When true, the control can display and accept multiple lines with line breaks; when false, only single-line text is supported.

Declaration

cs-api-definition
public bool Multiline { get; set; }

Property Value

bool

NullText

Gets or sets the placeholder text displayed when the text box is empty and does not have focus. This text provides users with hints about the expected input format or content.

Declaration

cs-api-definition
public string NullText { get; set; }

Property Value

string

NullTextColor

Gets or sets the color of the placeholder text displayed when the text box is empty. This property controls the visual appearance of the NullText when shown to users.

Declaration

cs-api-definition
[Browsable(false)]
public Color NullTextColor { get; set; }

Property Value

Color

PasswordChar

Gets or sets the character used to mask password characters in single-line text entry. When set to a non-null character, all typed characters will be displayed as this masking character for secure password input.

Declaration

cs-api-definition
public virtual char PasswordChar { get; set; }

Property Value

char

RadContextMenu

Gets or sets the context menu associated with this text box control. This property provides access to the right-click menu that appears when users right-click on the text box.

Declaration

cs-api-definition
public virtual RadContextMenu RadContextMenu { get; set; }

Property Value

RadContextMenu

A RadContextMenu that represents the shortcut menu associated with the control.

SelectedText

Gets or sets the currently selected text within the text box control. This property allows reading the selected text or replacing the selection with new text content.

Declaration

cs-api-definition
[Browsable(false)]
public string SelectedText { get; set; }

Property Value

string

SelectionColor

Gets or sets the background color used for selected text within the text box. This property controls the highlight color that appears behind selected text characters.

Declaration

cs-api-definition
[Browsable(false)]
public Color SelectionColor { get; set; }

Property Value

Color

SelectionLength

Gets or sets the number of characters in the current text selection. This property determines how many characters from the SelectionStart position are selected.

Declaration

cs-api-definition
[Browsable(false)]
public int SelectionLength { get; set; }

Property Value

int

SelectionOpacity

Gets or sets the opacity level of the text selection highlighting. This property controls the transparency of the selection background color, with values from 0 (fully transparent) to 100 (fully opaque).

Declaration

cs-api-definition
public int SelectionOpacity { get; set; }

Property Value

int

SelectionStart

Gets or sets the starting position of the text selection within the text box. This property represents the zero-based index where the text selection begins.

Declaration

cs-api-definition
[Browsable(false)]
public int SelectionStart { get; set; }

Property Value

int

ShowClearButton

Gets or sets a value indicating whether the clear button is displayed within the text box. When enabled, users can click the clear button to quickly remove all text from the control.

Declaration

cs-api-definition
public bool ShowClearButton { get; set; }

Property Value

bool

ShowEmbeddedLabel

Gets or sets a value indicating whether the embedded label is displayed within the text box. When enabled, the embedded label provides descriptive text that appears alongside the input area. It is recommended to set AutoSize to true when using the embedded label.

Declaration

cs-api-definition
public bool ShowEmbeddedLabel { get; set; }

Property Value

bool

ShowNullText

Gets or sets a value indicating whether the placeholder text remains visible when the control has focus and the text is empty. When true, NullText is displayed even when the control is focused; when false, it disappears on focus.

Declaration

cs-api-definition
public bool ShowNullText { get; set; }

Property Value

bool

Text

Gets or sets the text content displayed in the text box control. This property contains the actual text that users can view and edit within the control.

Declaration

cs-api-definition
[Bindable(true)]
public override string Text { get; set; }

Property Value

string

Overrides RadControl.Text

TextAlign

Gets or sets the horizontal alignment of text within the text box control. This property determines whether text is aligned to the left, center, or right within the control's bounds.

Declaration

cs-api-definition
public HorizontalAlignment TextAlign { get; set; }

Property Value

HorizontalAlignment

TextBoxElement

Gets the associated text box element that provides the core text editing functionality. This property provides access to the underlying RadTextBoxControlElement for advanced customization scenarios.

Declaration

cs-api-definition
[Browsable(false)]
public RadTextBoxControlElement TextBoxElement { get; }

Property Value

RadTextBoxControlElement

TextLength

Gets the total length of text currently contained in the text box. This property returns the number of characters in the Text property.

Declaration

cs-api-definition
[Browsable(false)]
public int TextLength { get; }

Property Value

int

UseSystemPasswordChar

Gets or sets a value indicating whether the text should be displayed using the system's default password character. When enabled, all characters in the text box are masked with the system password character for secure input.

Declaration

cs-api-definition
public virtual bool UseSystemPasswordChar { get; set; }

Property Value

bool

VerticalScrollBarState

Gets or sets when the vertical scroll bar should appear in a multiline text box. This property controls the visibility behavior of the vertical scrollbar based on content overflow.

Declaration

cs-api-definition
public ScrollState VerticalScrollBarState { get; set; }

Property Value

ScrollState

WordWrap

Gets or sets a value indicating whether text automatically wraps to the next line when it reaches the control's edge. When true in a multiline text box, long lines are broken at word boundaries; when false, horizontal scrolling is used instead.

Declaration

cs-api-definition
public bool WordWrap { get; set; }

Property Value

bool

Methods

AppendText(string)

Appends the specified text to the end of the current text content in the text box. This method adds new text without replacing existing content.

Declaration

cs-api-definition
public void AppendText(string text)

Parameters

text

string

The text to append to the existing content.

Clear()

Removes all text content from the text box, making it empty. This method clears the entire Text property and resets the cursor position.

Declaration

cs-api-definition
public void Clear()

Copy()

Copies the currently selected text to the clipboard without removing it from the text box. The selected text remains in the control and is available for pasting elsewhere.

Declaration

cs-api-definition
public bool Copy()

Returns

bool

true if the copy operation was successful; otherwise, false.

CreateAccessibilityInstance()

Creates an accessibility object for this text box control to support assistive technologies. When EnableRadAccessibilityObjects is enabled, returns a custom accessibility object; otherwise, returns the base implementation.

Declaration

cs-api-definition
protected override AccessibleObject CreateAccessibilityInstance()

Returns

AccessibleObject

An AccessibleObject that provides accessibility support for this control.

Overrides Control.CreateAccessibilityInstance()

CreateChildItems(RadElement)

Creates the child elements of the control by instantiating and configuring the internal RadTextBoxControlElement. This method sets up the text box element and establishes event handlers for text change notifications.

Declaration

cs-api-definition
protected override void CreateChildItems(RadElement parent)

Parameters

parent

RadElement

The parent RadElement that will contain the child elements.

Overrides RadControl.CreateChildItems(RadElement)

CreateTextBoxElement()

Creates the associated text box element that provides the core text editing functionality. This method can be overridden in derived classes to provide custom text box element implementations.

Declaration

cs-api-definition
protected virtual RadTextBoxControlElement CreateTextBoxElement()

Returns

RadTextBoxControlElement

A new instance of RadTextBoxControlElement or a derived class.

Cut()

Cuts the currently selected text to the clipboard, removing it from the text box. This operation combines copying the selection and deleting it from the control.

Declaration

cs-api-definition
public bool Cut()

Returns

bool

true if the cut operation was successful; otherwise, false.

Delete()

Deletes the character at the current cursor position. This method removes one character from the text content at the caret location.

Declaration

cs-api-definition
public bool Delete()

Returns

bool

true if the delete operation was successful; otherwise, false.

Delete(bool)

Deletes a character at the current cursor position with directional control. This method can delete either the character before (backspace) or after (delete) the cursor.

Declaration

cs-api-definition
public bool Delete(bool nextCharacter)

Parameters

nextCharacter

bool

true to delete the character after the cursor; false to delete the character before the cursor.

Returns

bool

true if the delete operation was successful; otherwise, false.

Delete(bool, bool)

Deletes text with advanced control over direction and word boundary behavior. When Control is pressed, deletion extends to word boundaries for faster text editing.

Declaration

cs-api-definition
public bool Delete(bool nextCharacter, bool isControlPressed)

Parameters

nextCharacter

bool

true to delete the character or word after the cursor; false to delete before the cursor.

isControlPressed

bool

true to delete to the end of the word; false to delete only a single character.

Returns

bool

true if the delete operation was successful; otherwise, false.

DeselectAll()

Clears the current text selection by setting the SelectionLength to zero. After calling this method, no characters will be selected in the text box.

Declaration

cs-api-definition
public bool DeselectAll()

Returns

bool

true if the selection was successfully cleared; otherwise, false.

Insert(string)

Inserts the specified text at the current cursor position or replaces the selected text. If text is selected, it will be replaced; otherwise, the text is inserted at the caret position.

Declaration

cs-api-definition
public bool Insert(string text)

Parameters

text

string

The text to insert into the text box.

Returns

bool

true if the insert operation was successful; otherwise, false.

OnGotFocus(EventArgs)

Handles the GotFocus event by transferring focus to the internal text box element and animating the embedded label. This method ensures proper focus management and visual feedback when the control receives focus.

Declaration

cs-api-definition
protected override void OnGotFocus(EventArgs e)

Parameters

e

EventArgs

An EventArgs containing the event data.

Overrides RadControl.OnGotFocus(EventArgs)

OnKeyPress(KeyPressEventArgs)

Handles key press events by delegating to the base implementation and internal behavior processing. This method processes character input for the text box control.

Declaration

cs-api-definition
protected override void OnKeyPress(KeyPressEventArgs e)

Parameters

e

KeyPressEventArgs

A KeyPressEventArgs containing the event data.

Overrides RadControl.OnKeyPress(KeyPressEventArgs)

OnLoad(Size)

Handles the load event by setting up the embedded label position based on the desired size. This method ensures proper layout initialization when the control is loaded.

Declaration

cs-api-definition
protected override void OnLoad(Size desiredSize)

Parameters

desiredSize

Size

The desired size for the control layout.

Overrides RadControl.OnLoad(Size)

OnLostFocus(EventArgs)

Handles the LostFocus event by removing focus from the internal text box element and animating the embedded label. This method ensures proper focus cleanup and visual feedback when the control loses focus.

Declaration

cs-api-definition
protected override void OnLostFocus(EventArgs e)

Parameters

e

EventArgs

An EventArgs containing the event data.

Overrides RadControl.OnLostFocus(EventArgs)

OnTextChanging(TextChangingEventArgs)

Raises the TextChanging event when text is about to change. This method provides an opportunity for derived classes to handle text changes before they occur.

Declaration

cs-api-definition
protected virtual void OnTextChanging(TextChangingEventArgs e)

Parameters

e

TextChangingEventArgs

The TextChangingEventArgs instance containing the event data.

Paste()

Replaces the currently selected text with the contents of the clipboard. If no text is selected, the clipboard content is inserted at the current cursor position.

Declaration

cs-api-definition
public bool Paste()

Returns

bool

true if the paste operation was successful; otherwise, false.

ProcessAutoSizeChanged(bool)

Processes changes to the AutoSize property and adjusts the control's stretch behavior. When AutoSize is disabled, the control can stretch vertically; when enabled, it maintains fixed height based on content.

Declaration

cs-api-definition
protected override void ProcessAutoSizeChanged(bool value)

Parameters

value

bool

The new value of the AutoSize property.

Overrides RadControl.ProcessAutoSizeChanged(bool)

ProcessDialogChar(char)

Processes dialog characters for the text box control, handling special key combinations. This method manages Alt and Control key combinations while allowing normal character processing for text input.

Declaration

cs-api-definition
protected override bool ProcessDialogChar(char charCode)

Parameters

charCode

char

The character code to process.

Returns

bool

true if the character was processed by this control; otherwise, false.

Overrides Control.ProcessDialogChar(char)

ProcessMnemonic(char)

Processes mnemonic characters for accessibility support. This method handles mnemonic key combinations but returns false as text boxes typically don't support mnemonics.

Declaration

cs-api-definition
protected override bool ProcessMnemonic(char charCode)

Parameters

charCode

char

The mnemonic character to process.

Returns

bool

false, as text boxes do not typically process mnemonic characters.

Overrides RadControl.ProcessMnemonic(char)

ResetBackColorThemeOverrides()

Resets theme overrides for the BackColor property on the text box element and its child elements. This method removes custom background color theming and restores default theme values.

Declaration

cs-api-definition
protected override void ResetBackColorThemeOverrides()

Overrides RadControl.ResetBackColorThemeOverrides()

ResetForeColorThemeOverrides()

Resets theme overrides for the ForeColor property on the text box element. This method removes custom foreground color theming and restores default theme values.

Declaration

cs-api-definition
protected override void ResetForeColorThemeOverrides()

Overrides RadControl.ResetForeColorThemeOverrides()

ScrollToCaret()

Scrolls the text box content to ensure the current caret position is visible. This method brings the cursor into view when it might be outside the visible area.

Declaration

cs-api-definition
public void ScrollToCaret()

Select(int, int)

Selects a range of text within the text box starting at the specified position. This method sets both the SelectionStart and SelectionLength properties.

Declaration

cs-api-definition
public void Select(int start, int length)

Parameters

start

int

The zero-based starting position of the text selection.

length

int

The number of characters to select from the starting position.

SelectAll()

Selects all text content in the text box. This method sets the selection to include the entire Text property content.

Declaration

cs-api-definition
public void SelectAll()

SetBackColorThemeOverrides()

Sets theme overrides for the BackColor property on the text box element and its child elements. This method applies the control's background color to all visual states of the internal text box components.

Declaration

cs-api-definition
protected override void SetBackColorThemeOverrides()

Overrides RadControl.SetBackColorThemeOverrides()

SetForeColorThemeOverrides()

Sets theme overrides for the ForeColor property on the text box element. This method applies the control's foreground color to all visual states of the internal text box component.

Declaration

cs-api-definition
protected override void SetForeColorThemeOverrides()

Overrides RadControl.SetForeColorThemeOverrides()

Events

ContextMenuOpening

Occurs when the context menu is about to be displayed, allowing customization of menu items. This event provides an opportunity to modify or replace the context menu before it appears to the user.

Declaration

cs-api-definition
public event TreeBoxContextMenuOpeningEventHandler ContextMenuOpening

Event Value

TreeBoxContextMenuOpeningEventHandler

CreateTextBlock

Occurs when a new text block instance is being created. This event allows customization of ITextBlock creation for advanced text rendering scenarios.

Declaration

cs-api-definition
public event CreateTextBlockEventHandler CreateTextBlock

Event Value

CreateTextBlockEventHandler

IMECompositionEnded

Occurs when the Input Method Editor (IME) completes text composition for international text input. This event is fired when users finish entering text using an IME and the composition process is complete.

Declaration

cs-api-definition
public event EventHandler IMECompositionEnded

Event Value

EventHandler

IMECompositionResult

Occurs when the Input Method Editor (IME) produces composition results during text input. This event is fired when IME has intermediate or final results ready, which may occur before composition ends for languages like Korean.

Declaration

cs-api-definition
public event EventHandler<IMECompositionResultEventArgs> IMECompositionResult

Event Value

EventHandler<IMECompositionResultEventArgs>

IMECompositionStarted

Occurs when the Input Method Editor (IME) starts text composition for international text input. This event is fired when users begin entering text using an IME for languages such as Chinese, Japanese, or Korean.

Declaration

cs-api-definition
public event EventHandler IMECompositionStarted

Event Value

EventHandler

SelectionChanged

Occurs after the text selection has changed. This event is raised whenever the user or code changes the selected text range within the control.

Declaration

cs-api-definition
public event SelectionChangedEventHandler SelectionChanged

Event Value

SelectionChangedEventHandler

SelectionChanging

Occurs when the text selection is about to change, allowing the change to be canceled. This event provides an opportunity to prevent selection changes by setting the Cancel property in the event arguments.

Declaration

cs-api-definition
public event SelectionChangingEventHandler SelectionChanging

Event Value

SelectionChangingEventHandler

TextBlockFormatting

Occurs when text blocks are being formatted, allowing custom styling of text portions. This event provides access to individual text blocks for applying custom formatting such as fonts, colors, or styles.

Declaration

cs-api-definition
public event TextBlockFormattingEventHandler TextBlockFormatting

Event Value

TextBlockFormattingEventHandler

TextChanging

Occurs when the text content is about to change, providing an opportunity to cancel the change. This event allows validation or modification of text before it is applied to the control.

Declaration

cs-api-definition
public event TextChangingEventHandler TextChanging

Event Value

TextChangingEventHandler