MFC tooltip for list control of dialog box

倖福魔咒の 提交于 2019-12-25 01:39:05

问题


I have developed on application, which shows a dialog box with two list controls. In this list control, I am showing images. Now I want is, when we move the mouse on images from the list control of dialog box, It will show tool tip for that.

How can I show tool tips for images in a list control in a dialog box?


回答1:


The CToolTipCtrl control is the MFC wrapper class around the Win32 "tool tip". You can use this to display a small pop-up window to describe another control or provide additional information in your app.

If you're using a ListBox control, explore one of these sample projects to see how to display tooltips for individual items displayed within that ListBox control:

  • ListBox With ToolTip Support
  • List Box With ToolTips

And if you're using a ListView control (CListCtrl in MFC), then you should start by reading the documentation for the GetToolTips function and the corresponding SetToolTips function. You can also check out how this sample ListView control implements tooltips:

  • CListCtrl and Displaying a Tooltip


来源:https://stackoverflow.com/questions/6633881/mfc-tooltip-for-list-control-of-dialog-box

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!