TextPointer.GetLineStartPosition Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Returns a TextPointer to the beginning of a line that is specified relative to the current TextPointer.
Overloads
GetLineStartPosition(Int32) |
Returns a TextPointer to the beginning of a line that is specified relative to the current TextPointer. |
GetLineStartPosition(Int32, Int32) |
Returns a TextPointer to the beginning of a line that is specified relative to the current TextPointer, and reports how many lines were skipped. |
GetLineStartPosition(Int32)
Returns a TextPointer to the beginning of a line that is specified relative to the current TextPointer.
public:
System::Windows::Documents::TextPointer ^ GetLineStartPosition(int count);
public System.Windows.Documents.TextPointer GetLineStartPosition (int count);
member this.GetLineStartPosition : int -> System.Windows.Documents.TextPointer
Public Function GetLineStartPosition (count As Integer) As TextPointer
Parameters
- count
- Int32
The number of start-of-line markers to skip when determining the line for which to return the starting position. Negative values specify preceding lines, 0 specifies the current line, and positive values specify following lines.
Returns
A TextPointer pointing to the beginning of the specified line (with the LogicalDirection set to Forward), or null
if the specified line is out of range or otherwise cannot be located.
Remarks
If the TextPointer points to an ambiguous position, for example, between two lines, the line in the direction specified by LogicalDirection is selected as the relative starting line.
The operation performed by this method depends on a valid layout. When necessary, this method attempts to automatically regenerate a valid layout before proceeding with the operation. Regenerating a layout can be a relatively expensive operation. Use HasValidLayout to check for a valid layout before performing operations that may regenerate the layout. For more information, see Layout.
Applies to
GetLineStartPosition(Int32, Int32)
Returns a TextPointer to the beginning of a line that is specified relative to the current TextPointer, and reports how many lines were skipped.
public:
System::Windows::Documents::TextPointer ^ GetLineStartPosition(int count, [Runtime::InteropServices::Out] int % actualCount);
public System.Windows.Documents.TextPointer GetLineStartPosition (int count, out int actualCount);
member this.GetLineStartPosition : int * int -> System.Windows.Documents.TextPointer
Public Function GetLineStartPosition (count As Integer, ByRef actualCount As Integer) As TextPointer
Parameters
- count
- Int32
The number of start-of-line markers to skip when determining the line for which to return the starting position. Negative values specify preceding lines, 0 specifies the current line, and positive values specify following lines.
- actualCount
- Int32
When this method returns, contains the actual number of start-of-line markers that were skipped when determining the line for which to return the starting position. This value may be less than count
if the beginning or end of content is encountered before the specified number of lines are skipped. This parameter is passed uninitialized.
Returns
A TextPointer pointing to the beginning of the specified line (with the LogicalDirection set to Forward), or to the beginning of the line closest to the specified line if the specified line is out of range.
Remarks
If the TextPointer points to an ambiguous position, for example, between two lines, the line in the direction specified by the LogicalDirection property is selected as the relative starting line.
Applies to
.NET
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기