This documentation is archived and is not being maintained.

TreeNode.ToolTip Property

Gets or sets the ToolTip text for the node.

Namespace:  System.Web.UI.WebControls
Assembly:  System.Web (in System.Web.dll)

public string ToolTip { get; set; }

Property Value

Type: System.String
The ToolTip text for the node. The default is an empty string ("").

Use the ToolTip property to specify the ToolTip text for the node. The ToolTip text is displayed when the mouse pointer is positioned over the node.

The value of this property, when set, can be saved automatically to a resource file by using a designer tool. For more information, see LocalizableAttribute and ASP.NET Globalization and Localization.

The following code example demonstrates how to use the ToolTip property to provide ToolTips for the nodes in the TreeView control.

<%@ Page Language="C#" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
<html xmlns="" >
  <head runat="server">
    <title>TreeNode ToolTip Example</title>
    <form id="form1" runat="server">

      <h3>TreeNode ToolTip Example</h3>

      <h5>Position the mouse pointer over a node.</h5>

      <asp:TreeView id="LinksTreeView"
        Font-Names= "Arial"


          <asp:TreeNodeStyle ChildNodesPadding="10" 
          <asp:TreeNodeStyle ChildNodesPadding="5" 
          <asp:TreeNodeStyle ChildNodesPadding="5" 
          <asp:TreeNodeStyle ChildNodesPadding="10" 



          <asp:TreeNode Text="Table of Contents"
            ToolTip="Table of Contents Description">

            <asp:TreeNode Text="Chapter One"
               ToolTip="Chapter One Description">

              <asp:TreeNode Text="Section 1.0"
                ToolTip="Section 1.0 Description">

                <asp:TreeNode Text="Topic 1.0.1"/>
                <asp:TreeNode Text="Topic 1.0.2"/>
                <asp:TreeNode Text="Topic 1.0.3"/>


              <asp:TreeNode Text="Section 1.1"
                ToolTip="Section 1.1 Description">

                <asp:TreeNode Text="Topic 1.1.1"/>
                <asp:TreeNode Text="Topic 1.1.2"/>
                <asp:TreeNode Text="Topic 1.1.3"/>
                <asp:TreeNode Text="Topic 1.1.4"/>



            <asp:TreeNode Text="Chapter Two"
              ToolTip="Chapter Two Description">

              <asp:TreeNode Text="Section 2.0"
                ToolTip="Section 2.0 Description">

                <asp:TreeNode Text="Topic 2.0.1"/>
                <asp:TreeNode Text="Topic 2.0.2"/>




          <asp:TreeNode Text="Appendix A" 
            ToolTip="Appendix A Description"/>
          <asp:TreeNode Text="Appendix B" 
            ToolTip="Appendix B Description"/>
          <asp:TreeNode Text="Appendix C" 
            ToolTip="Appendix C Description"/>




.NET Framework

Supported in: 4, 3.5, 3.0, 2.0

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.