Collapse All Expand All Code: All Code: Multiple Code: C# Code: Visual Basic

C#
Visual Basic

Azuki 1.7 Documentation
Document..::..SetSelection Method (Int32, Int32)
Document Class See Also Send Feedback

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

Exception | Condition
--- | ---
System..::..ArgumentOutOfRangeException | Specified index is out of valid range.

# See Also

Document Class
Document..::..Document Members
SetSelection Overload
Sgry.Azuki Namespace
Document.SelectionChanged event
Document.SetSelection method (another overloaded method)