Share via


TextSelection.SmartFormat-Methode

Formatiert die markierten Textzeilen entsprechend der aktuellen Sprache.

Namespace:  EnvDTE
Assembly:  EnvDTE (in EnvDTE.dll)

Syntax

'Declaration
Sub SmartFormat
void SmartFormat()
void SmartFormat()
abstract SmartFormat : unit -> unit 
function SmartFormat()

Hinweise

Zieht den markierten Text einschließlich der Zeilen mit dem Anker und den aktiven Enden entsprechend den globalen Einstellungen für intelligente Einzüge neu ein oder formatiert diesen.SmartFormat bewirkt, dass die Auswahl die vollständigen Zeilen an den Enden einschließt.

Beispiele

Sub SmartFormatExample()
   ' Before running this example, open a code document.
   Dim objSel As TextSelection = DTE.ActiveDocument.Selection
   ' Select all code in open document.
   objSel.SelectAll()
   ' Apply smart formatting rules for the language.
   objSel.SmartFormat()
End Sub

.NET Framework-Sicherheit

Siehe auch

Referenz

TextSelection Schnittstelle

EnvDTE-Namespace