Share via


TextSelection.NewLine 方法

在活动点位置插入换行符。

命名空间:  EnvDTE
程序集:  EnvDTE(在 EnvDTE.dll 中)

语法

声明
Sub NewLine ( _
    Count As Integer _
)
void NewLine(
    int Count
)
void NewLine(
    [InAttribute] int Count
)
abstract NewLine : 
        Count:int -> unit
function NewLine(
    Count : int
)

参数

  • Count
    类型:Int32

    可选。 表示要插入的换行符数。

备注

如果 Count 值为负,或者大于或等于 10,000,则 NewLine 失败。

示例

Sub NewLineExample()
   ' Before running this example, open a text document.
   Dim objSel As TextSelection = DTE.ActiveDocument.Selection
   ' Go to first line in document and select it.
   objSel.GotoLine(1, True)
   ' Insert some new lines and some text.
   objSel.NewLine(3)
   objSel.Insert("A new line", vsInsertFlags.vsInsertFlagsInsertAtStart)
End Sub

.NET Framework 安全性

请参阅

参考

TextSelection 接口

EnvDTE 命名空间