EditPoint.CharRight 方法

将编辑点右移指定的字符数。

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

语法

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

参数

  • Count
    类型:System.Int32
    可选。向右移动的字符数。默认值是一个字符。

备注

CharRight 将编辑点向右移动指定的字符数。如果已经到达文档结尾而移动字符数少于 Count 参数的字符数,则光标停在文档结尾。如果编辑点位于行尾,则 CharRight 将光标停在下一行的行首。换言之,所有换行序列都被视为单个字符。

如果 Count 的值为负,则 CharRight 的执行方式与 CharLeft 方法相同。

示例

Sub CharRightExample()
   Dim objTextDoc As TextDocument
   Dim objEditPt As EditPoint, iCtr As Integer
        
   ' Create a new text file.
   DTE.ItemOperations.NewFile("General\Text File")
        
   ' Get a handle to the new document and create an EditPoint.
   objTextDoc = DTE.ActiveDocument.Object("TextDocument")
   objEditPt = objTextDoc.StartPoint.CreateEditPoint
        
   ' Insert ten lines of text.
   For iCtr = 1 To 10
      objeditpt.Insert("This is a test." & Chr(13))
   Next iCtr
        
   ' Change the first letter of the fourth word of the fourth line.
   objEditPt.StartOfDocument()
   objEditPt.LineDown(3)
   objEditPt.WordRight(3)
   objEditPt.CharRight(2)
   objEditPt.Charleft(2)
   objeditpt.Delete(1)
   objEditPt.Insert("p")
End Sub

.NET Framework 安全性

请参见

参考

EditPoint 接口

EnvDTE 命名空间