EditPoint2.CharRight 方法 (Int32)

將編輯點向右移動指定的字元數目。

命名空間:  EnvDTE80
組件:  EnvDTE80 (在 EnvDTE80.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
    選擇項。要向右移動多少個字元。預設是一個字元。

實作

EditPoint.CharRight(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 安全性

請參閱

參考

EditPoint2 介面

CharRight 多載

EnvDTE80 命名空間