Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Display tooltip for each listbox item on combobox using ctooltipctrl

Display tooltip for each listbox item on combobox using ctooltipctrl

Scheduled Pinned Locked Moved C / C++ / MFC
help
8 Posts 3 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • U Offline
    U Offline
    User 10284669
    wrote on last edited by
    #1

    I have tried implementing the tooltip using ctooltipctrl for drop-down list items on a combobox. Have created one combo class to get the combo box handle and list box handle value. From combobox I have called the presubclasswindow method of listbox and enabled tooltips using enabletooltips(true) and inside the list box class I override the ontoolhittest to get the row and rect area. After this tnn_needtext notification has to be triggered to get the tooltip value.but in my case it is not getting triggered. Please help me to solve this issue. For the individual controls on dialogu box the tnn_needtext is getting triggered.

    V _ 2 Replies Last reply
    0
    • U User 10284669

      I have tried implementing the tooltip using ctooltipctrl for drop-down list items on a combobox. Have created one combo class to get the combo box handle and list box handle value. From combobox I have called the presubclasswindow method of listbox and enabled tooltips using enabletooltips(true) and inside the list box class I override the ontoolhittest to get the row and rect area. After this tnn_needtext notification has to be triggered to get the tooltip value.but in my case it is not getting triggered. Please help me to solve this issue. For the individual controls on dialogu box the tnn_needtext is getting triggered.

      V Offline
      V Offline
      Victor Nijegorodov
      wrote on last edited by
      #2

      I had the same problem last week! :) I can confirm the problem with tnn_needtext notification. You should use the tracking tooltips instead! Have a look at the article [XTipComboBox - Display tooltips for combobox](https://www.codeproject.com/Articles/4438/XTipComboBox-Display-tooltips-for-combobox) .

      U 1 Reply Last reply
      0
      • U User 10284669

        I have tried implementing the tooltip using ctooltipctrl for drop-down list items on a combobox. Have created one combo class to get the combo box handle and list box handle value. From combobox I have called the presubclasswindow method of listbox and enabled tooltips using enabletooltips(true) and inside the list box class I override the ontoolhittest to get the row and rect area. After this tnn_needtext notification has to be triggered to get the tooltip value.but in my case it is not getting triggered. Please help me to solve this issue. For the individual controls on dialogu box the tnn_needtext is getting triggered.

        _ Offline
        _ Offline
        _Flaviu
        wrote on last edited by
        #3

        You can find here[^] an extension of CComboBox, which do what you need, and more other.

        U 1 Reply Last reply
        0
        • _ _Flaviu

          You can find here[^] an extension of CComboBox, which do what you need, and more other.

          U Offline
          U Offline
          User 10284669
          wrote on last edited by
          #4

          i have used the tracking tool tips as mentioned in the provided link and it is working as expected. As per my project requirement i have to use CToolTipctrl to implement the tooltip for ComboBox. My question is can we implement tool-tip for combobox drop-down list using CtoolTipCtrl

          _ 1 Reply Last reply
          0
          • V Victor Nijegorodov

            I had the same problem last week! :) I can confirm the problem with tnn_needtext notification. You should use the tracking tooltips instead! Have a look at the article [XTipComboBox - Display tooltips for combobox](https://www.codeproject.com/Articles/4438/XTipComboBox-Display-tooltips-for-combobox) .

            U Offline
            U Offline
            User 10284669
            wrote on last edited by
            #5

            With the tracking tool tips the tooltip is getting displayed for each drop-down list item. Cant we implement the same tool tip functionality using CToolTipctrl. I have tried all the possible scenarios to implement using ctooltipctrl, but it is not working for combo box. Except for Combo box the remaining controls i.e. listbox and other controls the Ctooltipctrl is working. For combo box only we are not getting the TNN_NeedText notification

            V 1 Reply Last reply
            0
            • U User 10284669

              With the tracking tool tips the tooltip is getting displayed for each drop-down list item. Cant we implement the same tool tip functionality using CToolTipctrl. I have tried all the possible scenarios to implement using ctooltipctrl, but it is not working for combo box. Except for Combo box the remaining controls i.e. listbox and other controls the Ctooltipctrl is working. For combo box only we are not getting the TNN_NeedText notification

              V Offline
              V Offline
              Victor Nijegorodov
              wrote on last edited by
              #6

              Well, the problem with "not getting TNN_NeedText" for the listbox appears to be because this listbox's parent is neither dialog nor combobox window. Instead it is a desktop! However, TNN_NeedText like the other notifications are sent with WM_NOTIFY to the parent window.

              U 1 Reply Last reply
              0
              • U User 10284669

                i have used the tracking tool tips as mentioned in the provided link and it is working as expected. As per my project requirement i have to use CToolTipctrl to implement the tooltip for ComboBox. My question is can we implement tool-tip for combobox drop-down list using CtoolTipCtrl

                _ Offline
                _ Offline
                _Flaviu
                wrote on last edited by
                #7

                Then you can easily use CToolTipCtrl Class | Microsoft Docs[^] to use CTooltipCtrl ... I guess there will not be much to achieve this ...

                1 Reply Last reply
                0
                • V Victor Nijegorodov

                  Well, the problem with "not getting TNN_NeedText" for the listbox appears to be because this listbox's parent is neither dialog nor combobox window. Instead it is a desktop! However, TNN_NeedText like the other notifications are sent with WM_NOTIFY to the parent window.

                  U Offline
                  U Offline
                  User 10284669
                  wrote on last edited by
                  #8

                  Thanks victor for the providing the much needed answer :) is there any other possibility to overcome this issue by using any other methods like setting the parent window as combo-box for dropdown list using setparent() mfc method.

                  1 Reply Last reply
                  0
                  Reply
                  • Reply as topic
                  Log in to reply
                  • Oldest to Newest
                  • Newest to Oldest
                  • Most Votes


                  • Login

                  • Don't have an account? Register

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • World
                  • Users
                  • Groups