Class RadTextBoxControlElement
Represents an independent text box element
Inheritance
Inherited Members
Namespace: Telerik.WinControls.UI
Assembly: Telerik.WinControls.UI.dll
Syntax
public class RadTextBoxControlElement : ScrollViewElement<TextBoxViewElement>, INotifyPropertyChanged, ICustomTypeDescriptor, ISupportSystemSkin, IComponent, IDisposable, IBindableComponent, ISupportDrag, ISupportDrop, IShortcutProvider, IStylableElement, IStylableNode, IPrimitiveElement, IShapedElement, IFillElement, IBorderElement, IBoxStyle, IBoxElement, IImageElement, ITextPrimitive, ITextProvider
Constructors
RadTextBoxControlElement()
Initializes a new instance of the Rad
Declaration
public RadTextBoxControlElement()
Properties
AcceptsReturn
Gets or sets a value indicating whether pressing ENTER in a multiline TextBox element creates a new line of text in the element or activates the default button for the form.
Declaration
public bool AcceptsReturn { get; set; }
Property Value
System.
|
AcceptsTab
Gets or sets a value indicating whether pressing the TAB key in a multiline text box element types a TAB character in the element instead of moving the focus to the next element in the tab order.
Declaration
public bool AcceptsTab { get; set; }
Property Value
System.
|
AutoCompleteDataSource
Gets or sets a value specifying the source of complete items used for automatic completion.
Declaration
public object AutoCompleteDataSource { get; set; }
Property Value
System. The auto complete data source. |
AutoCompleteDisplayMember
Gets or sets the auto complete display member.
Declaration
public string AutoCompleteDisplayMember { get; set; }
Property Value
System. The auto complete display member. |
AutoCompleteDropDown
Gets the auto complete drop down.
Declaration
public RadPopupControlBase AutoCompleteDropDown { get; }
Property Value
AutoCompleteItems
Gets a value specifiying the complete items used for automatic completion.
Declaration
public RadListDataItemCollection AutoCompleteItems { get; }
Property Value
AutoCompleteMode
Gets or sets an option that controls how automatic completion works for the TextBox.
Declaration
public AutoCompleteMode AutoCompleteMode { get; set; }
Property Value
System. The auto complete mode. |
CanPerformAutoComplete
Gets a value indicating whether this text box can perform auto complete operation.
Declaration
protected virtual bool CanPerformAutoComplete { get; }
Property Value
System.
|
Caret
Gets the associated caret.
Declaration
public TextBoxControlCaret Caret { get; }
Property Value
CaretIndex
Gets or sets the caret position.
Declaration
public int CaretIndex { get; set; }
Property Value
System. The index of the caret. |
CharacterCasing
Gets or sets whether the TextBox element modifies the case of characters as they are typed.
Declaration
public CharacterCasing CharacterCasing { get; set; }
Property Value
System. The character casing. |
ClearButton
Gets the clear button.
Declaration
public LightVisualButtonElement ClearButton { get; }
Property Value
ContextMenu
Gets or sets the associated context menu.
Declaration
public RadContextMenu ContextMenu { get; set; }
Property Value
Rad The context menu. |
DropDownMaxSize
Gets or sets the size of the drop down max.
Declaration
public Size DropDownMaxSize { get; set; }
Property Value
System. The size of the drop down max. |
DropDownMinSize
Gets or sets the size of the drop down min.
Declaration
public Size DropDownMinSize { get; set; }
Property Value
System. The size of the drop down min. |
EmbeddedLabel
Gets an instance of the corresponding embedded label.
Declaration
public LightVisualElement EmbeddedLabel { get; }
Property Value
EmbeddedLabelAnimationSpeed
Gets or set the animation speed of the embedded label. The speed is an integer between 1(off) and 10(slowest) with default value of 8.
Declaration
public int EmbeddedLabelAnimationSpeed { get; set; }
Property Value
System.
|
EmbeddedLabelBorderOffset
Gets or set the offset of the embedded label from the bottom border, when the label is down.
Declaration
public float EmbeddedLabelBorderOffset { get; set; }
Property Value
System.
|
EmbeddedLabelText
Gets or sets the text of the embedded label.
Declaration
public string EmbeddedLabelText { get; set; }
Property Value
System.
|
HideSelection
Gets or sets a value indicating whether the selected text in the text box control remains highlighted when the element loses focus.
Declaration
public bool HideSelection { get; set; }
Property Value
System.
|
HorizontalScrollBarState
Gets or sets when the horizontal scroll bar should appear in a multiline TextBox element.
Declaration
public ScrollState HorizontalScrollBarState { get; set; }
Property Value
Scroll The state of the horizontal scroll bar. |
InputHandler
Represents the associated keyboard and mouse input handler.
Declaration
public ITextBoxInputHandler InputHandler { get; set; }
Property Value
IText The input handler. |
IsAutoCompleteDropDownOpen
Gets a value indicating whether this auto-complete drop down is open.
Declaration
public bool IsAutoCompleteDropDownOpen { get; }
Property Value
System.
|
IsReadOnly
Gets or sets a value indicating whether text in the text box is read-only.
Declaration
public bool IsReadOnly { get; set; }
Property Value
System.
|
IsReadOnlyCaretVisible
Gets or sets a value indicating whether the caret is visible in read only mode.
Declaration
public bool IsReadOnlyCaretVisible { get; set; }
Property Value
System.
|
Lines
Gets or sets the lines of text in a text box element.
Declaration
public string[] Lines { get; set; }
Property Value
System. The lines. |
ListElement
Gets the auto-complete list element.
Declaration
public RadTextBoxListElement ListElement { get; }
Property Value
MaxDropDownItemCount
Gets or sets the max count of visible items in auto-complete drop down
Declaration
public int MaxDropDownItemCount { get; set; }
Property Value
System. The max drop down item count. |
MaxLength
Gets or sets the maximum number of characters the user can type or paste into the text box element.
Declaration
public int MaxLength { get; set; }
Property Value
System. The length of the max. |
Multiline
Gets or sets a value indicating whether this is a multiline text box.
Declaration
public bool Multiline { get; set; }
Property Value
System.
|
Navigator
NullText
Gets or sets the prompt text that is displayed when the text box contains no text.
Declaration
public string NullText { get; set; }
Property Value
System. The null text. |
NullTextColor
Gets or sets the color of the null text.
Declaration
public Color NullTextColor { get; set; }
Property Value
System. The color of the null text. |
NullTextViewElement
Gets the view element of the null text.
Declaration
public TextBoxWrapPanel NullTextViewElement { get; }
Property Value
PasswordChar
Gets or sets the character used to mask characters of a password in a single-line
Declaration
public virtual char PasswordChar { get; set; }
Property Value
System.
|
RepositionEmbeddedLabel
Gets or set whether to reposition the embedded label, when text box is empty.
Declaration
public bool RepositionEmbeddedLabel { get; set; }
Property Value
System.
|
SelectedText
Gets or sets a value indicating the currently selected text in the element.
Declaration
public string SelectedText { get; set; }
Property Value
System. The selected text. |
SelectionColor
Gets or sets the color of the selection.
Declaration
public Color SelectionColor { get; set; }
Property Value
System. The color of the selection. |
SelectionLength
Gets or sets the number of characters selected in the text box.
Declaration
public int SelectionLength { get; set; }
Property Value
System. The length of the selection. |
SelectionOpacity
Gets or sets the selection opacity.
Declaration
public int SelectionOpacity { get; set; }
Property Value
System. The selection opacity. |
SelectionStart
Gets or sets the starting point of text selected in the text box.
Declaration
public int SelectionStart { get; set; }
Property Value
System. The selection start. |
ShowClearButton
Gets or sets a value indicating whether the clear button is shown.
Declaration
public bool ShowClearButton { get; set; }
Property Value
System.
|
ShowEmbeddedLabel
Gets or sets the visibility of the embedded label. It is recommended to set AutoSize to true, when using the embedded label.
Declaration
public bool ShowEmbeddedLabel { get; set; }
Property Value
System.
|
ShowNullText
Gets or sets a value indicating whether the null text will be shown when the control is focused and the text is empty
Declaration
public bool ShowNullText { get; set; }
Property Value
System.
|
Text
Gets or sets the current text in the text box element.
Declaration
public override string Text { get; set; }
Property Value
System.
|
Overrides
TextAlign
Gets or sets how the text is horizontally aligned in the element.
Declaration
public HorizontalAlignment TextAlign { get; set; }
Property Value
System. The horizontal text alignment. |
TextLength
Gets the length of text in the element.
Declaration
public int TextLength { get; }
Property Value
System. The length of the text. |
UseSystemPasswordChar
Gets or sets a value indicating whether the text in view should appear as the default password character.
Declaration
public virtual bool UseSystemPasswordChar { get; set; }
Property Value
System.
|
VerticalScrollBarState
Gets or sets when the vertical scroll bar should appear in a multiline TextBox element.
Declaration
public ScrollState VerticalScrollBarState { get; set; }
Property Value
Scroll The state of the vertical scroll bar. |
WordWrap
Indicates whether a multiline text box control automatically wraps words to the beginning of the next line when necessary.
Declaration
public bool WordWrap { get; set; }
Property Value
System.
|
Methods
AppendText(String)
Appends text to the current text of a text box.
Declaration
public void AppendText(string text)
Parameters
System. The text. |
AppendText(String, Boolean)
Appends text to the current text of a text box and selects it
Declaration
public void AppendText(string text, bool select)
Parameters
System. The text. |
System. if set to |
ArrangeOverride(SizeF)
Declaration
protected override SizeF ArrangeOverride(SizeF finalSize)
Parameters
System.
|
Returns
System.
|
Overrides
ArrangeViewElement(RectangleF)
Declaration
protected override void ArrangeViewElement(RectangleF viewElementRect)
Parameters
System.
|
Overrides
CanInsertText(String)
Determines whether the text can be inserted
Declaration
protected virtual bool CanInsertText(string text)
Parameters
System. The text. |
Returns
System.
|
ClampOffset(Int32)
Clamps the offset to valid text position bounds
Declaration
protected int ClampOffset(int offset)
Parameters
System. The offset. |
Returns
System.
|
Clear()
Clears all text from the text box element.
Declaration
public void Clear()
CloseDropDown()
Closes the auto-complete drop down.
Declaration
public void CloseDropDown()
CloseDropDown(RadPopupCloseReason)
Closes the drop down.
Declaration
public virtual void CloseDropDown(RadPopupCloseReason reason)
Parameters
Rad The reason. |
Copy()
Copies the current selection in the text box to the Clipboard.
Declaration
public virtual bool Copy()
Returns
System.
|
CreateAutoCompleteDropDown()
Creates the auto-complete drop down.
Declaration
protected virtual RadPopupControlBase CreateAutoCompleteDropDown()
Returns
CreateCaret()
Creates the caret of the text box element.
Declaration
protected virtual TextBoxControlCaret CreateCaret()
Returns
CreateChildElements()
Declaration
protected override void CreateChildElements()
Overrides
CreateClearButton()
Declaration
protected virtual LightVisualButtonElement CreateClearButton()
Returns
CreateEmbeddedLabel()
CreateListElement()
Creates the auto-complete list element.
Declaration
protected virtual RadTextBoxListElement CreateListElement()
Returns
CreateNullTextViewElement()
Creates an instance of Text
Declaration
protected virtual TextBoxWrapPanel CreateNullTextViewElement()
Returns
Cut()
Moves the current selection in the text box to the Clipboard.
Declaration
public virtual bool Cut()
Returns
System.
|
Delete()
Deletes the selected text or character at the current position
Declaration
public bool Delete()
Returns
System.
|
Delete(Boolean)
/// Deletes the selected text or character at the current position
Declaration
public virtual bool Delete(bool nextCharacter)
Parameters
System. if set to |
Returns
System.
|
Delete(Boolean, Boolean)
/// Deletes the selected text or character at the current position
Declaration
public virtual bool Delete(bool nextCharacter, bool isControlPressed)
Parameters
System. if set to |
System. True if Control modifier key is pressed. If set to true - it will delete to the end of the word. |
Returns
System.
|
DeselectAll()
Specifies that the value of the SelectionLength property is zero so that no characters are selected in the element.
Declaration
public virtual bool DeselectAll()
Returns
System.
|
DisposeUnmanagedResources()
Declaration
protected override void DisposeUnmanagedResources()
Overrides
DpiScaleChanged(SizeF)
Declaration
public override void DpiScaleChanged(SizeF scaleFactor)
Parameters
System.
|
Overrides
GetAutoCompleteDropDownLocation()
Gets the auto-complete drop down location.
Declaration
protected virtual Point GetAutoCompleteDropDownLocation()
Returns
System.
|
GetAutoCompleteTextCondition(TextPosition, TextPosition)
Gets the text that is as filter condition in auto-completion
Declaration
protected virtual string GetAutoCompleteTextCondition(TextPosition startPosition, TextPosition endPosition)
Parameters
Text The start position. |
Text The end position. |
Returns
System.
|
GetDropDownSize()
Gets the size of the auto-complete drop down.
Declaration
protected virtual Size GetDropDownSize()
Returns
System.
|
GetFirstAutoCompletePosition()
GetLastAutoCompletePosition()
GetLines()
Gets the lines of the text box element.
Declaration
protected virtual string[] GetLines()
Returns
System.
|
HandleSuggestedTextChanged(SuggestedTextChangedEventArgs)
Declaration
protected virtual void HandleSuggestedTextChanged(SuggestedTextChangedEventArgs e)
Parameters
InitializeFields()
Declaration
protected override void InitializeFields()
Overrides
Insert(String)
Inserts the text at current position
Declaration
public virtual bool Insert(string text)
Parameters
System. The text. |
Returns
System.
|
IsInputKey(InputKeyEventArgs)
Declaration
protected override bool IsInputKey(InputKeyEventArgs e)
Parameters
Returns
System.
|
Overrides
IsValidAutoCompletePosition()
Determines whether the current position is valid for the auto-complete operation
Declaration
protected virtual bool IsValidAutoCompletePosition()
Returns
System.
|
MeasureOverride(SizeF)
Declaration
protected override SizeF MeasureOverride(SizeF availableSize)
Parameters
System.
|
Returns
System.
|
Overrides
MeasureViewElement(SizeF)
Declaration
protected override void MeasureViewElement(SizeF availableSize)
Parameters
System.
|
Overrides
OnAutoCompleteDropDownClosed(RadAutoCompleteDropDownClosedEventArgs)
Declaration
protected virtual void OnAutoCompleteDropDownClosed(RadAutoCompleteDropDownClosedEventArgs e)
Parameters
OnBoundsChanged(RadPropertyChangedEventArgs)
Declaration
protected override void OnBoundsChanged(RadPropertyChangedEventArgs e)
Parameters
Overrides
OnContextMenuOpening(RadContextMenu)
Called when the context menu is opening.
Declaration
protected bool OnContextMenuOpening(RadContextMenu menu)
Parameters
Rad The menu. |
Returns
System.
|
OnContextMenuOpening(TreeBoxContextMenuOpeningEventArgs)
Raises the Context
Declaration
protected virtual void OnContextMenuOpening(TreeBoxContextMenuOpeningEventArgs e)
Parameters
Tree The Tree |
OnContextMenuOpenting(RadContextMenu)
Obsolete. The name of the method has a typo. Use the OnContextMenuOpening(RadContextMenu menu) method instead.
Declaration
[Obsolete("Obsolete. The name of the method has a typo. Use the OnContextMenuOpening(RadContextMenu menu) method instead.")]
protected bool OnContextMenuOpenting(RadContextMenu menu)
Parameters
Rad
|
Returns
System.
|
OnContextMenuOpenting(TreeBoxContextMenuOpeningEventArgs)
Obsolete.The name of the method has a typo. Use the OnContextMenuOpening(TreeBoxContextMenuOpeningEventArgs e) method instead.
Declaration
[Obsolete("Obsolete.The name of the method has a typo. Use the OnContextMenuOpening(TreeBoxContextMenuOpeningEventArgs e) method instead.")]
protected virtual void OnContextMenuOpenting(TreeBoxContextMenuOpeningEventArgs e)
Parameters
OnDoubleClick(EventArgs)
Declaration
protected override void OnDoubleClick(EventArgs e)
Parameters
System.
|
Overrides
OnIMECompositionEnded()
Declaration
protected virtual void OnIMECompositionEnded()
OnIMECompositionResult(String)
Declaration
protected virtual void OnIMECompositionResult(string result)
Parameters
System.
|
OnIMECompositionStarted()
Declaration
protected virtual void OnIMECompositionStarted()
OnKeyDown(KeyEventArgs)
Declaration
protected override void OnKeyDown(KeyEventArgs e)
Parameters
System.
|
Overrides
OnKeyPress(KeyPressEventArgs)
Declaration
protected override void OnKeyPress(KeyPressEventArgs e)
Parameters
System.
|
Overrides
OnKeyUp(KeyEventArgs)
Declaration
protected override void OnKeyUp(KeyEventArgs e)
Parameters
System.
|
Overrides
OnLoaded()
OnMouseDown(MouseEventArgs)
Declaration
protected override void OnMouseDown(MouseEventArgs e)
Parameters
System.
|
Overrides
OnMouseEnter(EventArgs)
Declaration
protected override void OnMouseEnter(EventArgs e)
Parameters
System.
|
Overrides
OnMouseLeave(EventArgs)
Declaration
protected override void OnMouseLeave(EventArgs e)
Parameters
System.
|
Overrides
OnMouseMove(MouseEventArgs)
Declaration
protected override void OnMouseMove(MouseEventArgs e)
Parameters
System.
|
Overrides
OnMouseUp(MouseEventArgs)
Declaration
protected override void OnMouseUp(MouseEventArgs e)
Parameters
System.
|
Overrides
OnMouseWheel(MouseEventArgs)
Declaration
protected override void OnMouseWheel(MouseEventArgs e)
Parameters
System.
|
Overrides
OnPropertyChanged(RadPropertyChangedEventArgs)
Declaration
protected override void OnPropertyChanged(RadPropertyChangedEventArgs e)
Parameters
Overrides
OnUnloaded(ComponentThemableElementTree)
Declaration
protected override void OnUnloaded(ComponentThemableElementTree oldTree)
Parameters
Component
|
Overrides
PaintText(IGraphics)
Declaration
protected override void PaintText(IGraphics graphics)
Parameters
IGraphics
graphics
|
Overrides
Paste()
Replaces the current selection in the text box with the contents of the Clipboard.
Declaration
public virtual bool Paste()
Returns
System.
|
PerformAutoComplete(EditOperation)
Performs the auto-complete for concrete operation.
Declaration
protected void PerformAutoComplete(EditOperation context)
Parameters
Edit The context. |
PerformAutoCompleteOverride(EditOperation)
Performs the auto complete override.
Declaration
protected virtual void PerformAutoCompleteOverride(EditOperation context)
Parameters
Edit The context. |
Redo()
Redo the last undo action.
Declaration
public virtual bool Redo()
Returns
System.
|
ScrollToCaret()
Scrolls the contents of the control to the current caret position.
Declaration
public void ScrollToCaret()
Select(Int32, Int32)
Selects a range of text in the text box.
Declaration
public void Select(int start, int length)
Parameters
System. The start. |
System. The length. |
SelectAll()
Selects all text in the text box element.
Declaration
public void SelectAll()
SetLines(String[])
Sets the lines of the text box element.
Declaration
protected virtual void SetLines(string[] value)
Parameters
System. The lines. |
ShowDropDown(Point)
Shows the drop down.
Declaration
public virtual void ShowDropDown(Point location)
Parameters
System. The location. |
ToggleTextPrimitive(RadProperty)
Declaration
protected override void ToggleTextPrimitive(RadProperty property)
Parameters
Rad
|
Overrides
Undo()
Undo the last action.
Declaration
public virtual bool Undo()
Returns
System.
|
Events
ContextMenuOpening
Occurs when the context menu is opening.
Declaration
public event TreeBoxContextMenuOpeningEventHandler ContextMenuOpening
Event Type
CreateTextBlock
Occurs when an instance of IText
Declaration
public event CreateTextBlockEventHandler CreateTextBlock
Event Type
IMECompositionEnded
Fired when the Input Method Editor completes the composition.
Declaration
public event EventHandler IMECompositionEnded
Event Type
System.
|
IMECompositionResult
Fired when the Input Method Editor has a result ready. For languages like Korean this might happen before the composition has ended.
Declaration
public event EventHandler<IMECompositionResultEventArgs> IMECompositionResult
Event Type
System.
|
IMECompositionStarted
Fired when the Input Method Editor starts the composition.
Declaration
public event EventHandler IMECompositionStarted
Event Type
System.
|
SelectionChanged
Occurs when text selection is changed.
Declaration
public event SelectionChangedEventHandler SelectionChanged
Event Type
SelectionChanging
Occurs when text selection is changing.
Declaration
public event SelectionChangingEventHandler SelectionChanging
Event Type
TextBlockFormatting
Occurs when text block is formatting.
Declaration
public event TextBlockFormattingEventHandler TextBlockFormatting