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 RadTextBoxControlElement class.
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.Boolean
|
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.Boolean
|
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.Object
The auto complete data source. |
AutoCompleteDisplayMember
Gets or sets the auto complete display member.
Declaration
public string AutoCompleteDisplayMember { get; set; }
Property Value
System.String
The auto complete display member. |
AutoCompleteDropDown
Gets the auto complete drop down.
Declaration
public RadPopupControlBase AutoCompleteDropDown { get; }
Property Value
RadPopupControlBase
|
AutoCompleteItems
Gets a value specifiying the complete items used for automatic completion.
Declaration
public RadListDataItemCollection AutoCompleteItems { get; }
Property Value
RadListDataItemCollection
|
AutoCompleteMode
Gets or sets an option that controls how automatic completion works for the TextBox.
Declaration
public AutoCompleteMode AutoCompleteMode { get; set; }
Property Value
System.Windows.Forms.AutoCompleteMode
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.Boolean
|
Caret
Gets the associated caret.
Declaration
public TextBoxControlCaret Caret { get; }
Property Value
TextBoxControlCaret
|
CaretIndex
Gets or sets the caret position.
Declaration
public int CaretIndex { get; set; }
Property Value
System.Int32
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.Windows.Forms.CharacterCasing
The character casing. |
ClearButton
Gets the clear button.
Declaration
public LightVisualButtonElement ClearButton { get; }
Property Value
LightVisualButtonElement
|
ContextMenu
Gets or sets the associated context menu.
Declaration
public RadContextMenu ContextMenu { get; set; }
Property Value
RadContextMenu
The context menu. |
DropDownMaxSize
Gets or sets the size of the drop down max.
Declaration
public Size DropDownMaxSize { get; set; }
Property Value
System.Drawing.Size
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.Drawing.Size
The size of the drop down min. |
EmbeddedLabel
Gets an instance of the corresponding embedded label.
Declaration
public LightVisualElement EmbeddedLabel { get; }
Property Value
LightVisualElement
|
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.Int32
|
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.Single
|
EmbeddedLabelText
Gets or sets the text of the embedded label.
Declaration
public string EmbeddedLabelText { get; set; }
Property Value
System.String
|
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.Boolean
|
HorizontalScrollBarState
Gets or sets when the horizontal scroll bar should appear in a multiline TextBox element.
Declaration
public ScrollState HorizontalScrollBarState { get; set; }
Property Value
ScrollState
The state of the horizontal scroll bar. |
InputHandler
Represents the associated keyboard and mouse input handler.
Declaration
public ITextBoxInputHandler InputHandler { get; set; }
Property Value
ITextBoxInputHandler
The input handler. |
IsAutoCompleteDropDownOpen
Gets a value indicating whether this auto-complete drop down is open.
Declaration
public bool IsAutoCompleteDropDownOpen { get; }
Property Value
System.Boolean
|
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.Boolean
|
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.Boolean
|
Lines
Gets or sets the lines of text in a text box element.
Declaration
public string[] Lines { get; set; }
Property Value
System.String[]
The lines. |
ListElement
Gets the auto-complete list element.
Declaration
public RadTextBoxListElement ListElement { get; }
Property Value
RadTextBoxListElement
|
MaxDropDownItemCount
Gets or sets the max count of visible items in auto-complete drop down
Declaration
public int MaxDropDownItemCount { get; set; }
Property Value
System.Int32
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.Int32
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.Boolean
|
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.String
The null text. |
NullTextColor
Gets or sets the color of the null text.
Declaration
public Color NullTextColor { get; set; }
Property Value
System.Drawing.Color
The color of the null text. |
NullTextViewElement
Gets the view element of the null text.
Declaration
public TextBoxWrapPanel NullTextViewElement { get; }
Property Value
TextBoxWrapPanel
|
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.Char
|
RepositionEmbeddedLabel
Gets or set whether to reposition the embedded label, when text box is empty.
Declaration
public bool RepositionEmbeddedLabel { get; set; }
Property Value
System.Boolean
|
SelectedText
Gets or sets a value indicating the currently selected text in the element.
Declaration
public string SelectedText { get; set; }
Property Value
System.String
The selected text. |
SelectionColor
Gets or sets the color of the selection.
Declaration
public Color SelectionColor { get; set; }
Property Value
System.Drawing.Color
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.Int32
The length of the selection. |
SelectionOpacity
Gets or sets the selection opacity.
Declaration
public int SelectionOpacity { get; set; }
Property Value
System.Int32
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.Int32
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.Boolean
|
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.Boolean
|
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.Boolean
|
Text
Gets or sets the current text in the text box element.
Declaration
public override string Text { get; set; }
Property Value
System.String
|
Overrides
TextAlign
Gets or sets how the text is horizontally aligned in the element.
Declaration
public HorizontalAlignment TextAlign { get; set; }
Property Value
System.Windows.Forms.HorizontalAlignment
The horizontal text alignment. |
TextLength
Gets the length of text in the element.
Declaration
public int TextLength { get; }
Property Value
System.Int32
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.Boolean
|
VerticalScrollBarState
Gets or sets when the vertical scroll bar should appear in a multiline TextBox element.
Declaration
public ScrollState VerticalScrollBarState { get; set; }
Property Value
ScrollState
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.Boolean
|
Methods
AppendText(String)
Appends text to the current text of a text box.
Declaration
public void AppendText(string text)
Parameters
System.String
text
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.String
text
The text. |
System.Boolean
select
if set to |
ArrangeOverride(SizeF)
Declaration
protected override SizeF ArrangeOverride(SizeF finalSize)
Parameters
System.Drawing.SizeF
finalSize
|
Returns
System.Drawing.SizeF
|
Overrides
ArrangeViewElement(RectangleF)
Declaration
protected override void ArrangeViewElement(RectangleF viewElementRect)
Parameters
System.Drawing.RectangleF
viewElementRect
|
Overrides
CanInsertText(String)
Determines whether the text can be inserted
Declaration
protected virtual bool CanInsertText(string text)
Parameters
System.String
text
The text. |
Returns
System.Boolean
|
ClampOffset(Int32)
Clamps the offset to valid text position bounds
Declaration
protected int ClampOffset(int offset)
Parameters
System.Int32
offset
The offset. |
Returns
System.Int32
|
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
RadPopupCloseReason
reason
The reason. |
Copy()
Copies the current selection in the text box to the Clipboard.
Declaration
public virtual bool Copy()
Returns
System.Boolean
|
CreateAutoCompleteDropDown()
Creates the auto-complete drop down.
Declaration
protected virtual RadPopupControlBase CreateAutoCompleteDropDown()
Returns
RadPopupControlBase
|
CreateCaret()
Creates the caret of the text box element.
Declaration
protected virtual TextBoxControlCaret CreateCaret()
Returns
TextBoxControlCaret
|
CreateChildElements()
Declaration
protected override void CreateChildElements()
Overrides
CreateClearButton()
Declaration
protected virtual LightVisualButtonElement CreateClearButton()
Returns
LightVisualButtonElement
|
CreateEmbeddedLabel()
CreateListElement()
Creates the auto-complete list element.
Declaration
protected virtual RadTextBoxListElement CreateListElement()
Returns
RadTextBoxListElement
|
CreateNullTextViewElement()
Creates an instance of TextBoxWrapPanel
Declaration
protected virtual TextBoxWrapPanel CreateNullTextViewElement()
Returns
TextBoxWrapPanel
|
Cut()
Moves the current selection in the text box to the Clipboard.
Declaration
public virtual bool Cut()
Returns
System.Boolean
|
Delete()
Deletes the selected text or character at the current position
Declaration
public bool Delete()
Returns
System.Boolean
|
Delete(Boolean)
/// Deletes the selected text or character at the current position
Declaration
public virtual bool Delete(bool nextCharacter)
Parameters
System.Boolean
nextCharacter
if set to |
Returns
System.Boolean
|
Delete(Boolean, Boolean)
/// Deletes the selected text or character at the current position
Declaration
public virtual bool Delete(bool nextCharacter, bool isControlPressed)
Parameters
System.Boolean
nextCharacter
if set to |
System.Boolean
isControlPressed
True if Control modifier key is pressed. If set to true - it will delete to the end of the word. |
Returns
System.Boolean
|
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.Boolean
|
DisposeUnmanagedResources()
Declaration
protected override void DisposeUnmanagedResources()
Overrides
DpiScaleChanged(SizeF)
Declaration
public override void DpiScaleChanged(SizeF scaleFactor)
Parameters
System.Drawing.SizeF
scaleFactor
|
Overrides
GetAutoCompleteDropDownLocation()
Gets the auto-complete drop down location.
Declaration
protected virtual Point GetAutoCompleteDropDownLocation()
Returns
System.Drawing.Point
|
GetAutoCompleteTextCondition(TextPosition, TextPosition)
Gets the text that is as filter condition in auto-completion
Declaration
protected virtual string GetAutoCompleteTextCondition(TextPosition startPosition, TextPosition endPosition)
Parameters
TextPosition
startPosition
The start position. |
TextPosition
endPosition
The end position. |
Returns
System.String
|
GetDropDownSize()
Gets the size of the auto-complete drop down.
Declaration
protected virtual Size GetDropDownSize()
Returns
System.Drawing.Size
|
GetFirstAutoCompletePosition()
GetLastAutoCompletePosition()
GetLines()
Gets the lines of the text box element.
Declaration
protected virtual string[] GetLines()
Returns
System.String[]
|
HandleSuggestedTextChanged(SuggestedTextChangedEventArgs)
Declaration
protected virtual void HandleSuggestedTextChanged(SuggestedTextChangedEventArgs e)
Parameters
SuggestedTextChangedEventArgs
e
|
InitializeFields()
Declaration
protected override void InitializeFields()
Overrides
Insert(String)
Inserts the text at current position
Declaration
public virtual bool Insert(string text)
Parameters
System.String
text
The text. |
Returns
System.Boolean
|
IsInputKey(InputKeyEventArgs)
Declaration
protected override bool IsInputKey(InputKeyEventArgs e)
Parameters
InputKeyEventArgs
e
|
Returns
System.Boolean
|
Overrides
IsValidAutoCompletePosition()
Determines whether the current position is valid for the auto-complete operation
Declaration
protected virtual bool IsValidAutoCompletePosition()
Returns
System.Boolean
|
MeasureOverride(SizeF)
Declaration
protected override SizeF MeasureOverride(SizeF availableSize)
Parameters
System.Drawing.SizeF
availableSize
|
Returns
System.Drawing.SizeF
|
Overrides
MeasureViewElement(SizeF)
Declaration
protected override void MeasureViewElement(SizeF availableSize)
Parameters
System.Drawing.SizeF
availableSize
|
Overrides
OnAutoCompleteDropDownClosed(RadAutoCompleteDropDownClosedEventArgs)
Declaration
protected virtual void OnAutoCompleteDropDownClosed(RadAutoCompleteDropDownClosedEventArgs e)
Parameters
RadAutoCompleteDropDownClosedEventArgs
e
|
OnBoundsChanged(RadPropertyChangedEventArgs)
Declaration
protected override void OnBoundsChanged(RadPropertyChangedEventArgs e)
Parameters
RadPropertyChangedEventArgs
e
|
Overrides
OnContextMenuOpening(RadContextMenu)
Called when the context menu is opening.
Declaration
protected bool OnContextMenuOpening(RadContextMenu menu)
Parameters
RadContextMenu
menu
The menu. |
Returns
System.Boolean
|
OnContextMenuOpening(TreeBoxContextMenuOpeningEventArgs)
Raises the ContextMenuOpenting event.
Declaration
protected virtual void OnContextMenuOpening(TreeBoxContextMenuOpeningEventArgs e)
Parameters
TreeBoxContextMenuOpeningEventArgs
e
The TreeBoxContextMenuOpeningEventArgs instance containing the event data. |
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
RadContextMenu
menu
|
Returns
System.Boolean
|
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
TreeBoxContextMenuOpeningEventArgs
e
|
OnDoubleClick(EventArgs)
Declaration
protected override void OnDoubleClick(EventArgs e)
Parameters
System.EventArgs
e
|
Overrides
OnIMECompositionEnded()
Declaration
protected virtual void OnIMECompositionEnded()
OnIMECompositionResult(String)
Declaration
protected virtual void OnIMECompositionResult(string result)
Parameters
System.String
result
|
OnIMECompositionStarted()
Declaration
protected virtual void OnIMECompositionStarted()
OnKeyDown(KeyEventArgs)
Declaration
protected override void OnKeyDown(KeyEventArgs e)
Parameters
System.Windows.Forms.KeyEventArgs
e
|
Overrides
OnKeyPress(KeyPressEventArgs)
Declaration
protected override void OnKeyPress(KeyPressEventArgs e)
Parameters
System.Windows.Forms.KeyPressEventArgs
e
|
Overrides
OnKeyUp(KeyEventArgs)
Declaration
protected override void OnKeyUp(KeyEventArgs e)
Parameters
System.Windows.Forms.KeyEventArgs
e
|
Overrides
OnLoaded()
OnMouseDown(MouseEventArgs)
Declaration
protected override void OnMouseDown(MouseEventArgs e)
Parameters
System.Windows.Forms.MouseEventArgs
e
|
Overrides
OnMouseEnter(EventArgs)
Declaration
protected override void OnMouseEnter(EventArgs e)
Parameters
System.EventArgs
e
|
Overrides
OnMouseLeave(EventArgs)
Declaration
protected override void OnMouseLeave(EventArgs e)
Parameters
System.EventArgs
e
|
Overrides
OnMouseMove(MouseEventArgs)
Declaration
protected override void OnMouseMove(MouseEventArgs e)
Parameters
System.Windows.Forms.MouseEventArgs
e
|
Overrides
OnMouseUp(MouseEventArgs)
Declaration
protected override void OnMouseUp(MouseEventArgs e)
Parameters
System.Windows.Forms.MouseEventArgs
e
|
Overrides
OnMouseWheel(MouseEventArgs)
Declaration
protected override void OnMouseWheel(MouseEventArgs e)
Parameters
System.Windows.Forms.MouseEventArgs
e
|
Overrides
OnPropertyChanged(RadPropertyChangedEventArgs)
Declaration
protected override void OnPropertyChanged(RadPropertyChangedEventArgs e)
Parameters
RadPropertyChangedEventArgs
e
|
Overrides
OnUnloaded(ComponentThemableElementTree)
Declaration
protected override void OnUnloaded(ComponentThemableElementTree oldTree)
Parameters
ComponentThemableElementTree
oldTree
|
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.Boolean
|
PerformAutoComplete(EditOperation)
Performs the auto-complete for concrete operation.
Declaration
protected void PerformAutoComplete(EditOperation context)
Parameters
EditOperation
context
The context. |
PerformAutoCompleteOverride(EditOperation)
Performs the auto complete override.
Declaration
protected virtual void PerformAutoCompleteOverride(EditOperation context)
Parameters
EditOperation
context
The context. |
Redo()
Redo the last undo action.
Declaration
public virtual bool Redo()
Returns
System.Boolean
|
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.Int32
start
The start. |
System.Int32
length
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.String[]
value
The lines. |
ShowDropDown(Point)
Shows the drop down.
Declaration
public virtual void ShowDropDown(Point location)
Parameters
System.Drawing.Point
location
The location. |
ToggleTextPrimitive(RadProperty)
Declaration
protected override void ToggleTextPrimitive(RadProperty property)
Parameters
RadProperty
property
|
Overrides
Undo()
Undo the last action.
Declaration
public virtual bool Undo()
Returns
System.Boolean
|
Events
ContextMenuOpening
Occurs when the context menu is opening.
Declaration
public event TreeBoxContextMenuOpeningEventHandler ContextMenuOpening
Event Type
TreeBoxContextMenuOpeningEventHandler
|
CreateTextBlock
Occurs when an instance of ITextBlock is created
Declaration
public event CreateTextBlockEventHandler CreateTextBlock
Event Type
CreateTextBlockEventHandler
|
IMECompositionEnded
Fired when the Input Method Editor completes the composition.
Declaration
public event EventHandler IMECompositionEnded
Event Type
System.EventHandler
|
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.EventHandler<IMECompositionResultEventArgs>
|
IMECompositionStarted
Fired when the Input Method Editor starts the composition.
Declaration
public event EventHandler IMECompositionStarted
Event Type
System.EventHandler
|
SelectionChanged
Occurs when text selection is changed.
Declaration
public event SelectionChangedEventHandler SelectionChanged
Event Type
SelectionChangedEventHandler
|
SelectionChanging
Occurs when text selection is changing.
Declaration
public event SelectionChangingEventHandler SelectionChanging
Event Type
SelectionChangingEventHandler
|
TextBlockFormatting
Occurs when text block is formatting.
Declaration
public event TextBlockFormattingEventHandler TextBlockFormatting
Event Type
TextBlockFormattingEventHandler
|