共用方式為


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 命名空間