Export (0) Print
Expand All

ToolTip Element (IntelliSense Code Snippets)

Describes the expected value and usage of a literal or object in a code snippet, which Visual Studio displays in a ToolTip when it inserts the code snippet into a project.

<CodeSnippets>
   <CodeSnippet>
     <Snippet>
       <Declarations>
         <Literal>
           <ToolTip>
             <Object>
               <ToolTip>
<ToolTip>
    ToolTip description
</ToolTip>

The following sections describe attributes, child elements, and parent elements.

Attributes

None.

Child Elements

None.

Parent Elements

Element

Description

Literal

Defines the literal fields of the code snippet that you can edit.

Object

Defines the object fields of the code snippet that you can edit.

A text value is required.

This text specifies the ToolTip description to be associated with the object or literal in the code snippet.

The ToolTip text is displayed when the mouse hovers over the literal or object after the code snippet has been inserted.

The following example shows how to declare ToolTip elements for Literal and Object elements.

<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
    <CodeSnippet Format="1.0.0">
        <Header>
            <!-- Insert Header information here. -->
        </Header>
        <Snippet>
            <Declarations>
                <Literal>
                    <ID>SQL</ID>
                    <ToolTip>Replace with a SQL connection string.</ToolTip>
                    <Default>"SQL connection string"</Default>
                </Literal>
                <Object>
                    <ID>Connection</ID>
                    <Type>System.Data.SqlClient.SqlConnection</Type>
                    <ToolTip>Replace with a connection object in your application.</ToolTip>
                    <Default>dcConnection</Default>
                </Object>
            </Declarations>
            <Code Language="CSharp">
                <!-- Insert code here. -->
            </Code>
        </Snippet>
    </CodeSnippet>
</CodeSnippets>
Show:
© 2014 Microsoft