This documentation is archived and is not being maintained.

TextSelection.Mode Property

Sets or gets a value determining whether dragging the mouse selects in stream or block mode.

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

vsSelectionMode Mode { get; set; }
/** @property */
vsSelectionMode get_Mode ()

/** @property */
void set_Mode (/** @attribute InAttribute() */ vsSelectionMode pMode)

function get Mode () : vsSelectionMode

function set Mode (pMode : vsSelectionMode)

Property Value

A vsSelectionMode constant.

Mode can be set only when the selection is collapsed to a single point. By default, methods that extend the selection do so in stream mode. Any method or action that collapses the selection automatically sets Mode to vsSelectionModeStream.

Sub ModeExample()
   ' Before running this example, open a text document.
   Dim objSel As TextSelection = DTE.ActiveDocument.Selection
   MsgBox("Selection mode: " & objSel.Mode.ToString)
   objSel.Mode = vsSelectionMode.vsSelectionModeBox
   MsgBox("Selection mode: " & objSel.Mode.ToString)
End Sub