Metodo TextSelection.CharLeft

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

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

Sintassi

'Dichiarazione
Sub CharLeft ( _
    Extend As Boolean, _
    Count As Integer _
)
void CharLeft(
    bool Extend,
    int Count
)
void CharLeft(
    [InAttribute] bool Extend, 
    [InAttribute] int Count
)
abstract CharLeft : 
        Extend:bool * 
        Count:int -> unit 
function CharLeft(
    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 a sinistra.Il valore predefinito è 1.

Note

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

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

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

Esempi

Sub ChangeLeftExample()
   ' 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