Table of Contents

Class Caret

Namespace
Alternet.UI
Assembly
Alternet.UI.Common.dll

A caret is a blinking cursor showing the position where the typed text will appear. Text controls usually have their own caret but Caret provides a way to use a caret in other controls.

public class Caret : HandledObject<ICaretHandler>, IBaseObjectWithId, IImmutableObject, IDisposableObject, IDisposable, IBaseObject, INotifyPropertyChanged
Inheritance
Caret
Implements

Remarks

A caret is always associated with a control and the current caret can be retrieved using AbstractControl methods. The same caret can't be reused in two different controls.

Constructors

Caret()

Initializes a new instance of the Caret class.

Caret(AbstractControl, int, int)

Initializes a new instance of the Caret class with the given size (in pixels) and associates it with the control.

Properties

BlinkTime

Gets or sets blink time of the carets.

CaretOffMSec

Time, in milliseconds, for how long a blinking caret should stay invisible during a single blink cycle before it reappears.

CaretOnMSec

Time, in milliseconds, for how long a blinking caret should stay visible during a single blink cycle before it disappears.

CaretTimeoutMSec

Time, in milliseconds, for how long a caret should blink after a user interaction.

Control

Gets control where caret is located.

IsOk

Returns true if the caret was created successfully.

Position

Gets or sets the caret position (in pixels).

PositionDip

Gets or sets caret's position in device-independent units. This property returns Null and doesn't change caret's position if caret is not attached to the control (Control property is Null).

Size

Gets or sets the caret size.

UseGeneric

Gets or sets whether to use internal caret. This can be used for testing purposes. Usage of this property depends on platform.

Visible

Gets or sets a bool value indicating whether the caret is visible.

Methods

CreateHandler()

Creates handler.

GetPosition(AbstractControl?)

Gets caret position for the specified control.

Hide()

Hides the caret, same as Show(false).

Show(bool)

Shows or hides the caret.

Events

ControlPositionChanged

Occurs when caret position is changed. This event is called only for the carets attached to the controls (Control property is not Null).