ClassCaret
Represents a special TextBox used to insert text in RadRichTextBox
Definition
Namespace:Telerik.Windows.Documents.UI
Assembly:Telerik.Windows.Controls.RichTextBox.dll
Syntax:
public class Caret : TextBox
Inheritance: objectCaret
Constructors
Properties
CaretBaseLineOffset
Represents the base line offset of the caret in the UI component.
CurrentImeLanguage
Returns the current IME language.
Declaration
public ImeLanguage CurrentImeLanguage { get; }
Property Value
EnableAsynchronousTextInsertion
Gets or sets a value indicating whether asynchronous text insertion is enabled.
Declaration
protected bool EnableAsynchronousTextInsertion { get; set; }
Property Value
true if asynchronous text insertion is enabled; otherwise, false.
InputState
Represents the state of the input caret within a document, providing information about its position and behavior during text editing operations.
Declaration
public InputStates InputState { get; protected set; }
Property Value
IsBlinking
Gets or sets a value indicating whether the caret is blinking.
Declaration
public bool IsBlinking { get; set; }
Property Value
true if the caret is blinking; otherwise, false.
LastInputEvent
Declaration
protected InputEvents LastInputEvent { get; set; }
Property Value
MinimumTextInsertedInterval
Gets or sets the minimum interval (in milliseconds) between two consecutive raises of TextInserted event.
The value is respected only when EnableAsynchronousTextInsertion is true.
The default value is 15.
Declaration
protected int MinimumTextInsertedInterval { get; set; }
Property Value
The minimum interval (in milliseconds) between two consecutive raises of TextInserted event.
Text
Gets or sets the text contents of the text box, with all new lines removed.
UsePreviousVersionOfMicrosoftIme
Gets or sets whether you want to use the previous version of Microsoft IME.
Declaration
public bool UsePreviousVersionOfMicrosoftIme { get; set; }
Property Value
Methods
ArrangeOverride(Size)
Declaration
protected override Size ArrangeOverride(Size arrangeBounds)
Parameters
arrangeBounds
Size
Returns
Size
ClearText()
Clears the text currently in the caret.
Declaration
protected void ClearText()
FinishComposition()
Declaration
protected virtual void FinishComposition()
IsOemKey(Key)
Declaration
[SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Oem")]
protected bool IsOemKey(Key key)
Parameters
key
Key
Returns
OnApplyTemplate()
Is called when a control template is applied.
Declaration
public override void OnApplyTemplate()
OnGotFocus(RoutedEventArgs)
Declaration
protected override void OnGotFocus(RoutedEventArgs e)
Parameters
e
RoutedEventArgs
OnImeCaretMoved(ImeCaretMovedEventArgs)
Declaration
protected virtual void OnImeCaretMoved(ImeCaretMovedEventArgs args)
Parameters
args
OnInitialized(EventArgs)
Raises the event. This method is invoked whenever is set to true internally.
Declaration
protected override void OnInitialized(EventArgs e)
Parameters
e
The RoutedEventArgs that contains the event data.
OnKeyDown(KeyEventArgs)
Invoked whenever an unhandled attached routed event reaches an element derived from this class in its route. Implement this method to add class handling for this event.
Declaration
protected override void OnKeyDown(KeyEventArgs e)
Parameters
e
KeyEventArgs
Provides data about the event.
OnLostFocus(RoutedEventArgs)
Declaration
protected override void OnLostFocus(RoutedEventArgs e)
Parameters
e
RoutedEventArgs
OnMouseLeftButtonUp(MouseButtonEventArgs)
Invoked when an unhandled routed event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.
Declaration
protected override void OnMouseLeftButtonUp(MouseButtonEventArgs e)
Parameters
e
MouseButtonEventArgs
The MouseButtonEventArgs that contains the event data. The event data reports that the left mouse button was released.
OnPreviewKeyDown(KeyEventArgs)
Called when the occurs.
Declaration
protected override void OnPreviewKeyDown(KeyEventArgs e)
Parameters
e
KeyEventArgs
The event data.
OnTextChanged()
Declaration
protected virtual void OnTextChanged()
OnTextChanged(TextChangedEventArgs)
Is called when content in this editing control changes.
Declaration
protected override void OnTextChanged(TextChangedEventArgs e)
Parameters
e
TextChangedEventArgs
The arguments that are associated with the event.
OnTextInput(TextCompositionEventArgs)
Invoked whenever an unhandled attached routed event reaches an element derived from this class in its route. Implement this method to add class handling for this event.
Declaration
protected override void OnTextInput(TextCompositionEventArgs e)
Parameters
e
TextCompositionEventArgs
Provides data about the event.
OnTextInputStart(object, TextCompositionEventArgs)
Declaration
protected virtual void OnTextInputStart(object sender, TextCompositionEventArgs e)
Parameters
sender
e
TextCompositionEventArgs
OnTextInputUpdate(object, TextCompositionEventArgs)
Declaration
protected virtual void OnTextInputUpdate(object sender, TextCompositionEventArgs e)
Parameters
sender
e
TextCompositionEventArgs
OnTextInserted(object, TextInsertedEventArgs)
Called when text is inserted in the caret, but not often than MinimumTextInsertedInterval.
Declaration
protected virtual void OnTextInserted(object sender, TextInsertedEventArgs e)
Parameters
sender
The sender.
e
The TextInsertedEventArgs instance containing the event data.
SetStyle(double, bool, Color)
Sets the style of the caret in the text editor.
Declaration
public void SetStyle(double fontSize, bool isItalic, Color caretColor)
Parameters
fontSize
The font size to determine the height of the caret.
isItalic
A boolean indicating whether the current style is italic.
caretColor
Color
The color of the caret, specified as a Color object.
Events
ImeCaretMoved
Declaration
public event EventHandler<ImeCaretMovedEventArgs> ImeCaretMoved
Event Value
TextInserted
Occurs when text is inserted in the caret, but not more often than MinimumTextInsertedInterval.
Declaration
public event EventHandler<TextInsertedEventArgs> TextInserted
Event Value