ITextSnapshot::GetLineNumberFromPosition Method (Int32)

 

Gets the number of the line that contains the character at the specified position.

Namespace:   Microsoft.VisualStudio.Text
Assembly:  Microsoft.VisualStudio.Text.Data (in Microsoft.VisualStudio.Text.Data.dll)

int GetLineNumberFromPosition(
	int position
)

Parameters

position
Type: System::Int32

The position from which to get the line number.

Return Value

Type: System::Int32

The line number of the line in which position lies.

Exception Condition
ArgumentOutOfRangeException

position is less than zero or greater than the length of the line.

Return to top
Show: