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)

Syntax

'Declaration
Property Mode As vsSelectionMode
vsSelectionMode Mode { get; set; }
property vsSelectionMode Mode {
    vsSelectionMode get ();
    void set (vsSelectionMode value);
}
abstract Mode : vsSelectionMode with get, set
function get Mode () : vsSelectionMode 
function set Mode (value : vsSelectionMode)

Property Value

Type: EnvDTE.vsSelectionMode
A vsSelectionMode constant.

Remarks

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.

Examples

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

.NET Framework Security

See Also

Reference

TextSelection Interface

EnvDTE Namespace