Sets selection range.

Namespace: Sgry.Azuki
Assembly: Azuki (in Azuki.dll) Version: 1.7.13.40248

Syntax

C#
public void SetSelection(
	int anchor,
	int caret
)
Visual Basic
Public Sub SetSelection ( 
	anchor As Integer,
	caret As Integer
)

Parameters

anchor
Type: System..::..Int32
new index of the selection anchor
caret
Type: System..::..Int32
new index of the caret

Remarks

This method sets selection range and invokes Document.SelectionChanged event. If given index is at middle of an undividable character sequence such as surrogate pair, selection range will be automatically expanded to avoid dividing the it.

This method always selects text as a sequence of character. To select text by lines or by rectangle, use other overload method instead.

Exceptions

ExceptionCondition
System..::..ArgumentOutOfRangeExceptionSpecified index is out of valid range.

See Also