次の方法で共有


TextSelection.Mode Property

Definition

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

public:
 property EnvDTE::vsSelectionMode Mode { EnvDTE::vsSelectionMode get(); void set(EnvDTE::vsSelectionMode value); };
public:
 property EnvDTE::vsSelectionMode Mode { EnvDTE::vsSelectionMode get(); void set(EnvDTE::vsSelectionMode value); };
[System.Runtime.InteropServices.DispId(55)]
public EnvDTE.vsSelectionMode Mode { [System.Runtime.InteropServices.DispId(55)] get; [System.Runtime.InteropServices.DispId(55)] set; }
[<System.Runtime.InteropServices.DispId(55)>]
[<get: System.Runtime.InteropServices.DispId(55)>]
[<set: System.Runtime.InteropServices.DispId(55)>]
member this.Mode : EnvDTE.vsSelectionMode with get, set
Public Property Mode As vsSelectionMode

Property Value

A vsSelectionMode constant.

Attributes

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  

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.

Applies to