Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set tooltip for a ListviewItem

I am using a ListView with a few fixed-size columns.

The text in the rows may be too large to fit in the column, so I would like to make it so that when the user hovers over the ListViewItem, it shows a tooltip with more text.

I tried setting the ToolTipText property of the ListViewItem:

ListViewItem iListView = new ListViewItem("add");  iListView.ToolTipText = "Add Expanded"; myListView.Items.Add(iListView); 

Unfortunately, it didn't seem to work. How can I get ListViewItems to show ToolTips?

like image 742
Gaddigesh Avatar asked Apr 28 '10 15:04

Gaddigesh


People also ask

What is tooltip control?

A tooltip control can be either active or inactive. When it is active, the tooltip text appears when the mouse pointer is on a tool. When it is inactive, the tooltip text does not appear, even if the pointer is on a tool. The TTM_ACTIVATE message activates and deactivates a tooltip control.

What is tooltip in Visual Studio?

A tooltip is a small pop-up window that displays some information when you rollover on a control. In this article, I will discuss how to create and use a Tooltip control in a Windows Forms application using Visual Studio 2010.


1 Answers

Set the ListView's ShowItemToolTips property to true.

like image 173
SLaks Avatar answered Sep 29 '22 23:09

SLaks