TextSelection.StartOfLine(vsStartOfLineOptions, Boolean) Methode
Definition
Wichtig
Einige Informationen beziehen sich auf Vorabversionen, die vor dem Release ggf. grundlegend überarbeitet werden. Microsoft übernimmt hinsichtlich der hier bereitgestellten Informationen keine Gewährleistungen, seien sie ausdrücklich oder konkludent.
Verschiebt das Objekt an den Anfang der aktuellen Zeile.
void StartOfLine(EnvDTE::vsStartOfLineOptions Where = EnvDTE.vsStartOfLineOptions.vsStartOfLineOptionsFirstColumn, bool Extend = false);
[System.Runtime.InteropServices.DispId(27)]
public void StartOfLine (EnvDTE.vsStartOfLineOptions Where = EnvDTE.vsStartOfLineOptions.vsStartOfLineOptionsFirstColumn, bool Extend = false);
[<System.Runtime.InteropServices.DispId(27)>]
abstract member StartOfLine : EnvDTE.vsStartOfLineOptions * bool -> unit
Public Sub StartOfLine (Optional Where As vsStartOfLineOptions = EnvDTE.vsStartOfLineOptions.vsStartOfLineOptionsFirstColumn, Optional Extend As Boolean = false)
Parameter
- Where
- vsStartOfLineOptions
(Optional) Eine vsStartOfLineOptions-Konstante, die den Anfang der Zeile darstellt.
- Extend
- Boolean
(Optional) Bestimmt, ob der verschobene Text reduziert ist. Der Standardwert lautet false.
- Attribute
Beispiele
Sub StartOfLineExample()
' Before running this example, open a text document.
Dim objSel As TextSelection = DTE.ActiveDocument.Selection
Dim objActive As VirtualPoint = objSel.ActivePoint
' Collapse the selection to the beginning of the line.
objSel.StartOfLine()
' objActive is "live", tied to the position of the actual selection,
' so it will reflect the new position.
Dim iCol As Long = objActive.DisplayColumn
' Move the selection to the end of the line.
objSel.EndOfLine()
MsgBox("The length of the insertion point line is " & (objActive.DisplayColumn - iCol) & " display characters.")
End Sub
Hinweise
Wenn Extend True den Wert hat, wird nur das aktive Ende der Textauswahl an den Anfang des Dokuments verschoben. Andernfalls wird die Textauswahl reduziert und verschoben.