TextSelection.EndOfLine(Boolean) 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
将对象移动到当前行的行尾。
void EndOfLine(bool Extend = false);
[System.Runtime.InteropServices.DispId(26)]
public void EndOfLine (bool Extend = false);
[<System.Runtime.InteropServices.DispId(26)>]
abstract member EndOfLine : bool -> unit
Public Sub EndOfLine (Optional Extend As Boolean = false)
参数
- Extend
- Boolean
可选。 确定所移动的文本是否折叠。 默认为 false。
- 属性
示例
Sub EndOfLineExample()
' Before running this example, open a text document.
Dim objSel As TextSelection = DTE.ActiveDocument.Selection
Dim objActive As VirtualPoint = objSel.ActivePoint
' Collapse the selection to the beginning of the line.
objSel.StartOfLine()
' objActive is "live", tied to the position of the actual selection,
' so it will reflect the new position.
Dim iCol As Long = objActive.DisplayColumn
' Move the selection to the end of the line.
objSel.EndOfLine()
MsgBox("The length of the insertion point line is " & (objActive.DisplayColumn - iCol) & " display characters.")
End Sub
注解
如果 Extend 为 true ,则仅移动文本选定内容的活动端。 否则,所选内容将折叠并置于文档末尾。