How to show a tooltip for the title bar of a ListView ListView control?

I can set the ToolTip property of a ListView control, but for the whole control.

Can I just open the tooltip for the Details View header area?

+5
source share
1 answer

ObjectListView (an open source wrapper around .NET WinForms ListView) supports tooltips for headers.

Functionality is not very easy to reproduce in a standard ListView, but I will outline the necessary steps:

  1. get ListView header control (using LVM_GETHEADER message)
  2. Create a tooltip that is for the title only. The standard .NET ToolTip class cannot do this, since it only works on full controls, and you only have a handle)
  3. Listen to the TTN_GETDISPINFO prompts and fill out the NMTTDISPINFO structure accordingly.

Indeed, it is much simpler to use an ObjectListView, which makes the ListView much easier to use and much more functional. This snapshot shows a header hint that was dynamically generated in response to the HeaderToolTip event:

alt text

+3
source

All Articles