Metodo TextSelection.CharRight

Sposta l'oggetto a destra in base al numero di caratteri specificato.

Spazio dei nomi:  EnvDTE
Assembly:  EnvDTE (in EnvDTE.dll)

Sintassi

'Dichiarazione
Sub CharRight ( _
    Extend As Boolean, _
    Count As Integer _
)
void CharRight(
    bool Extend,
    int Count
)
void CharRight(
    [InAttribute] bool Extend, 
    [InAttribute] int Count
)
abstract CharRight : 
        Extend:bool * 
        Count:int -> unit 
function CharRight(
    Extend : boolean, 
    Count : int
)

Parametri

  • Extend
    Tipo: System.Boolean
    Facoltativo.Determina se il testo spostato è compresso.Il valore predefinito è false.
  • Count
    Tipo: System.Int32
    Facoltativo.Rappresenta il numero di caratteri in base a cui spostare il testo verso destra.Il valore predefinito è 1.

Note

Se Extend è true, l'estremità attiva del testo selezionato viene spostata verso destra del numero di caratteri specificato in Count. In caso contrario, il testo verrà compresso e spostato a destra dell'estremità attiva in base al numero di caratteri specificato in Count.

Se la fine del documento viene raggiunta prima del numero di caratteri specificato in Count, la posizione verrà lasciata alla fine del documento. Se l'estremità attiva si trova alla fine di una riga, il metodo CharLeft la lascerà all'inizio della riga precedente. Questo significa che tutte le sequenze di nuove righe verranno trattate come caratteri singoli.

Se Count è negativo, il metodo CharRight si comporta come il metodo CharLeft.

Esempi

Sub CharRightExample()
   ' Open a document before running this example.
   Dim objSel As TextSelection = DTE.ActiveDocument.Selection
   objSel.StartOfDocument(True)
   objSel.StartOfLine(vsStartOfLineOptions.vsStartOfLineOptionsFirstText)
   objSel.CharRight(True, 4)
   objSel.ChangeCase(vsCaseOptions.vsCaseOptionsUppercase)
   MsgBox("Turned text uppercase.")
   objSel.CharLeft(False, 1)
   objSel.ChangeCase(vsCaseOptions.vsCaseOptionsLowercase)
   MsgBox("Turned text lowercase.")
End Sub

Sicurezza di .NET Framework

Vedere anche

Riferimenti

TextSelection Interfaccia

Spazio dei nomi EnvDTE