Udostępnij za pośrednictwem


Metoda TextSelection.DestructiveInsert —

Wstawia tekst, zastępując istniejący tekst.

Przestrzeń nazw:  EnvDTE
Zestaw:  EnvDTE (w EnvDTE.dll)

Składnia

'Deklaracja
Sub DestructiveInsert ( _
    Text As String _
)
void DestructiveInsert(
    string Text
)
void DestructiveInsert(
    [InAttribute] String^ Text
)
abstract DestructiveInsert : 
        Text:string -> unit
function DestructiveInsert(
    Text : String
)

Parametry

  • Text
    Typ: String

    Wymagany.Reprezentuje tekst do wstawienia.

Uwagi

Znaki nowego wiersza powoduje zaznaczenie tekstu aktywnego end, aby przejść na początek następnego wiersza.To także wstawić wcięcia w zależności od języka używanego w dokumencie tekstowym.

Przykłady

Public objSel As TextSelection = DTE.ActiveDocument.Selection

Sub DestructiveInsertExample()
   ' Before running this example, open a text document.
   ' Perform operations on the text.
   objSel.StartOfDocument(False)
   Position(vsStartOfLineOptions.vsStartOfLineOptionsFirstColumn, 4)
   objSel.Copy()
   Position(vsStartOfLineOptions.vsStartOfLineOptionsFirstText, 4)
   objSel.Cut()
   Position(vsStartOfLineOptions.vsStartOfLineOptionsFirstText, 4)
   objSel.Delete()
   Position(vsStartOfLineOptions.vsStartOfLineOptionsFirstText, 4)
   objSel.DeleteLeft(6)
   objSel.DestructiveInsert("NEW TEXT")
End Sub

Sub Position(ByVal pos As vsStartOfLineOptions, ByVal ipos As Integer)
   ' Moves the insertion point down to the beginning of the next line, 
   ' and then highlights the right-most four characters.
   objSel.LineDown()
   objSel.StartOfLine(vsStartOfLineOptions.vsStartOfLineOptionsFirstText)
   objSel.CharRight(True, 4)
End Sub

Zabezpieczenia programu .NET Framework

Zobacz też

Informacje

TextSelection Interfejs

Przestrzeń nazw EnvDTE