Mostly I'm happy with the default behavior of the ListView ToolTips in
the app I'm working on. In detail view, they display the subitem text
if it's too wide for its column.
What's silly, however, is that the ListView's ToolTips won't word wrap
if the text is very long... they'll happily exceed the screen width, in
fact.
Using some interop with SendMessage, I can send LVM_GETTOOLTIPS to the
ListView's Handle, then send TTM_SETMAXTIPWIDTH to the returned ToolTip
handle. I can even verify that the width I'm setting is being set is
being stored: on a second SendMessage to the ToolTip of
TTM_SETMAXTIPWIDTH, the value I set is being returned. So everything
looks good.
Except... it doesn't actually work. The ToolTip still won't wrap the
text, which does contain plenty of spaces.
That's a little puzzling, so I thought I'd pose some questions here.
First, would there be more than a single ToolTip control associated
with a ListView, so that LVM_GETTOOLTIPS is perhaps returning something
other than the control shown when hovering over subitems? And if that's
the case, how do I get the correct handle?
Second, if I am indeed sending TTM_SETMAXTIPWIDTH to the correct
control, why wouldn't the setting be respected? I'm testing on XP SP2,
using the .NET 2.0 framework, so things should be pretty current.
Thanks in advance for any suggestions!
Dave