Expand method

ITextRange.Expand method

Expands a text range to completely contain any partial text units.

Syntax


int Expand(
  TextRangeUnit unit
)

Parameters

unit

Type: TextRangeUnit

The text unit to use to expand the range. The default value is Word.

Return value

Type: System.Int32 [.NET] | int32 [C++]

The number of characters added to the text range, if the range was expanded to include a partially contained unit.

Remarks

For example, if the insertion point is at the beginning, the end, or inside a word, the Expand method expands the range to include that word. If the range already includes one word and part of another, Expand expands the range to include both words.

Requirements (Windows 10 device family)

Device family

Universal, introduced version 10.0.10240.0

API contract

Windows.Foundation.UniversalApiContract, introduced version 1.0

Namespace

Windows.UI.Text
Windows::UI::Text [C++]

Metadata

Windows.Foundation.UniversalApiContract.winmd

Requirements (Windows 8.x and Windows Phone 8.x)

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Minimum supported phone

Windows Phone 8.1 [Windows Runtime apps only]

Namespace

Windows.UI.Text
Windows::UI::Text [C++]

Metadata

Windows.winmd

See also

ITextRange

 

 

Show:
© 2016 Microsoft