Condividi tramite


IVsLanguageTextOps.GetDataTip Method

Displays a tip over a span of text when the mouse hovers over this location.

Namespace:  Microsoft.VisualStudio.TextManager.Interop
Assembly:  Microsoft.VisualStudio.TextManager.Interop (in Microsoft.VisualStudio.TextManager.Interop.dll)

Syntax

'Declaration
Function GetDataTip ( _
    pTextLayer As IVsTextLayer, _
    ptsSel As TextSpan(), _
    <OutAttribute> ptsTip As TextSpan(), _
    <OutAttribute> ByRef pbstrText As String _
) As Integer
int GetDataTip(
    IVsTextLayer pTextLayer,
    TextSpan[] ptsSel,
    TextSpan[] ptsTip,
    out string pbstrText
)
int GetDataTip(
    [InAttribute] IVsTextLayer^ pTextLayer, 
    [InAttribute] array<TextSpan>^ ptsSel, 
    [OutAttribute] array<TextSpan>^ ptsTip, 
    [OutAttribute] String^% pbstrText
)
abstract GetDataTip : 
        pTextLayer:IVsTextLayer * 
        ptsSel:TextSpan[] * 
        ptsTip:TextSpan[] byref * 
        pbstrText:string byref -> int
function GetDataTip(
    pTextLayer : IVsTextLayer, 
    ptsSel : TextSpan[], 
    ptsTip : TextSpan[], 
    pbstrText : String
) : int

Parameters

  • pbstrText
    Type: System.String%

    [out] Returns the text of the tip to display.

Return Value

Type: System.Int32
If the method succeeds, it returns S_OK. If it fails, it returns an error code.

Remarks

COM Signature

From textmgr.idl:

HRESULT IVsLanguageTextOps::GetDataTip(
   [in] IVsTextLayer *pTextLayer, 
   [in] const TextSpan *ptsSel, 
   [out] TextSpan *ptsTip, 
   [out, retval] BSTR *pbstrText
);

Use the IVsTextLayer object to access the applicable text within the text span (ptsSel) for the tip.

What is displayed depends on the language service. For example, in Visual C#, holding the cursor over a variable typically shows the type of that variable. This method is also used with when debugging a program: this method is called to obtain the type and name of a variable while the debugger is asked for the value of the variable. The two pieces of information are then combined and displayed in a single data tip.

.NET Framework Security

See Also

Reference

IVsLanguageTextOps Interface

Microsoft.VisualStudio.TextManager.Interop Namespace