登录 注册
当前位置:主页 > 资源下载 > 50 > Multiline balloon tooltips on ListView items下载

Multiline balloon tooltips on ListView items下载

  • 更新:2024-07-14 22:08:14
  • 大小:5KB
  • 推荐:★★★★★
  • 来源:网友上传分享
  • 类别:Web开发 - 开发技术
  • 格式:RAR

资源介绍

Description: The attached code demonstrates a technique you can use to create multiline balloon tooltips for ListView items.The code is based on the following simple idea. In the MouseMove event you need to check the index of the item under the mouse pointer, and if this item is changed, you simply redefine the text of the tooltip attached to the ListView control. Notice that you should destroy the tooltip if there is no any item under the mouse pointer.To determine the index of the list-view item under the mouse pointer, we send the LVM_HITTEST message to the ListView control. The SendMessage function you should use to send this message returns the index of the item at the specified position, if any, or -1 otherwise. Before you send the message, populate the pt field of an instance of the LVHITTESTINFO structure with the coordinates of the mouse pointer (you pass the reference to this structure as the value of the lParam parameter in SendMessage). You can use for this purpose the X and Y parameters of the MouseMove event of the control, but draw attention at the fact that these parameters can be measured in twips and you need to convert them in pixels.This simple idea can be used to create such tooltips for ListBox items, any grid control items and so on. For instance, we use this technique in extra samples for iGrid ActiveX Control we produce (this is an editable replacement for ListView and FlexGrid