This documentation is archived and is not being maintained.

ListView.ShowItemToolTips Property

Note: This property is new in the .NET Framework version 2.0.

Gets or sets a value indicating whether ToolTips are shown for the ListViewItem objects contained in the ListView.

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in system.windows.forms.dll)

public bool ShowItemToolTips { get; set; }
/** @property */
public boolean get_ShowItemToolTips ()

/** @property */
public void set_ShowItemToolTips (boolean value)

public function get ShowItemToolTips () : boolean

public function set ShowItemToolTips (value : boolean)

Property Value

true if ListViewItem ToolTips should be shown; otherwise, false. The default is true.

If the ShowItemToolTips property is set to true, any ListViewItem that has a ToolTip will display it; otherwise, nothing is displayed.

When FullRowSelect is set to true, ToolTips for a ListViewItem.ListViewSubItem will not be shown; only the ToolTip for the parent ListViewItem will display.

The following code example demonstrates how to use the ShowItemToolTips and ListViewItem.ToolTipText properties. To run this example, paste the code into a Windows Form and call InitializeItemsWithToolTips from the form's constructor or Load event handler.


// Declare the ListView.
private ListView ListViewWithToolTips;
private void InitializeItemsWithToolTips()
{

    // Construct and set the View property of the ListView.
    ListViewWithToolTips = new ListView();
    ListViewWithToolTips.Width = 200;
    ListViewWithToolTips.View = View.List;

    // Show item tooltips.
    ListViewWithToolTips.ShowItemToolTips = true;
    
    // Create items with a tooltip.
    ListViewItem item1WithToolTip = new ListViewItem("Item with a tooltip");
    item1WithToolTip.ToolTipText = "This is the item tooltip.";
    ListViewItem item2WithToolTip = new ListViewItem("Second item with a tooltip");
    item2WithToolTip.ToolTipText = "A different tooltip for this item.";

    // Create an item without a tooltip.
    ListViewItem itemWithoutToolTip = new ListViewItem("Item without tooltip.");

    // Add the items to the ListView.
    ListViewWithToolTips.Items.AddRange(new ListViewItem[]{item1WithToolTip, 
        item2WithToolTip, itemWithoutToolTip} );

    // Add the ListView to the form.
    this.Controls.Add(ListViewWithToolTips);
    this.Controls.Add(button1);
}

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

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

.NET Framework

Supported in: 2.0
Show: