共用方式為


IVsTextView.GetSelectionSpan 方法

傳回選取範圍相關聯的文字範圍。

命名空間:  Microsoft.VisualStudio.TextManager.Interop
組件:  Microsoft.VisualStudio.TextManager.Interop (在 Microsoft.VisualStudio.TextManager.Interop.dll 中)

語法

'宣告
Function GetSelectionSpan ( _
    <OutAttribute> pSpan As TextSpan() _
) As Integer
int GetSelectionSpan(
    TextSpan[] pSpan
)
int GetSelectionSpan(
    [OutAttribute] array<TextSpan>^ pSpan
)
abstract GetSelectionSpan : 
        pSpan:TextSpan[] byref -> int
function GetSelectionSpan(
    pSpan : TextSpan[]
) : int

參數

傳回值

類型:Int32
如果此方法將會成功,則會傳回S_OK。如果失敗,它就會傳回錯誤碼。

備註

COM 簽章

從 textmgr.idl:

HRESULT IVsTextView::GetSelectionSpan(
   [out] TextSpan *pSpan
);

這個方法很類似GetSelection ,但傳回TextSpan結構,以文字緩衝區的座標。

.NET Framework 安全性

請參閱

參考

IVsTextView 介面

Microsoft.VisualStudio.TextManager.Interop 命名空間