Compartilhar via


Interface TextSelection

Fornece Acessar ao Exibir com base em operações de edição e o texto selecionado.

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

Sintaxe

<GuidAttribute("1FA0E135-399A-4D2C-A4FE-D21E2480F921")> _
Public Interface TextSelection

Dim instance As TextSelection
[GuidAttribute("1FA0E135-399A-4D2C-A4FE-D21E2480F921")]
public interface TextSelection
[GuidAttribute(L"1FA0E135-399A-4D2C-A4FE-D21E2480F921")]
public interface class TextSelection
public interface TextSelection

Comentários

As propriedades e métodos do objeto TextSelection diretamente refletem comandos do editor no ambiente de desenvolvimento integrado a Visual Studio (IDE).Como o ambiente, a seleção de texto operações são afetadas por estado global do editor, como se ele está em substituir modo virtual espaço em branco ou.

Qualquer operação de tentativa de modificar um documento de texto falha se ela afeta os caracteres contidos em um Bloquear de somente leitura, ou se o documento de texto em si é somente leitura.

Algumas das propriedades e métodos do objeto TextSelection poderá falhar se o documento associado é um documento HTML.Possíveis causas da falha são: as janelas que exibem o documento HTML não estão no Exibir Origem ou os dados por trás o documento de texto estão bloqueados.

Exemplos

Sub TextSelectionExample()
   ' 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

Consulte também

Referência

TextSelection Membros

Espaço para nome EnvDTE