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. How to display tool tips...

How to display tool tips...

Scheduled Pinned Locked Moved C / C++ / MFC
tutorial
3 Posts 2 Posters 0 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
    ugur_basak
    wrote on last edited by
    #1

    I want to show CToolTipCtrl object when user enters invalid character. Actually i want to use that class when i want. But i cant find a solution. Is there anyway to override that functionality. I use several methods, but cant do what i want. I use ShowWindow like funtctions, but they just show and disappear. They dont even there for a few miliseconds:) Being mortal is what makes impossible possible.

    N 1 Reply Last reply
    0
    • U ugur_basak

      I want to show CToolTipCtrl object when user enters invalid character. Actually i want to use that class when i want. But i cant find a solution. Is there anyway to override that functionality. I use several methods, but cant do what i want. I use ShowWindow like funtctions, but they just show and disappear. They dont even there for a few miliseconds:) Being mortal is what makes impossible possible.

      N Offline
      N Offline
      narendra_ b
      wrote on last edited by
      #2

      i)declare CToolTipCtrl in ur class like CToolTipCtrl m_ToolTipCtrl ; ii) add the following code in constructor TOOLINFO ti; DWORD dwStyle = TTS_BALLOON; m_ToolTipCtrl .Create(this, dwStyle); m_ToolTipCtrl .FillInToolInfo(ti, this, 0); ti.uFlags |= (TTF_TRACK |TTF_ABSOLUTE ); ti.lpszText = (LPTSTR)_T("Enter Valid Phone number"); m_ToolTipCtrl .SendMessage (TTM_ADDTOOL, 0,reinterpret_cast (&ti)); iii) add the following code, where u want to show the tooltip LPTSTR lpszMessage = _T("Enter Tooltip text here"); m_ToolTipCtrl.Activate(TRUE) ; CToolInfo ti; m_ToolTipCtrl.GetToolInfo(ti, this, 0); ti.lpszText = lpszMessage; m_ToolTipCtrl .SetToolInfo(&ti); m_ToolTipCtrl .SendMessage (TTM_TRACKPOSITION, 0, MAKELPARAM(rect.right - 20, rect.CenterPoint().y)); m_ToolTipCtrl .SendMessage (TTM_TRACKACTIVATE, TRUE,reinterpret_cast(&ti)); this code i got from some post for more info follow this link http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/commctls/tooltip/usingtooltips.asp naren VC++ programmer

      U 1 Reply Last reply
      0
      • N narendra_ b

        i)declare CToolTipCtrl in ur class like CToolTipCtrl m_ToolTipCtrl ; ii) add the following code in constructor TOOLINFO ti; DWORD dwStyle = TTS_BALLOON; m_ToolTipCtrl .Create(this, dwStyle); m_ToolTipCtrl .FillInToolInfo(ti, this, 0); ti.uFlags |= (TTF_TRACK |TTF_ABSOLUTE ); ti.lpszText = (LPTSTR)_T("Enter Valid Phone number"); m_ToolTipCtrl .SendMessage (TTM_ADDTOOL, 0,reinterpret_cast (&ti)); iii) add the following code, where u want to show the tooltip LPTSTR lpszMessage = _T("Enter Tooltip text here"); m_ToolTipCtrl.Activate(TRUE) ; CToolInfo ti; m_ToolTipCtrl.GetToolInfo(ti, this, 0); ti.lpszText = lpszMessage; m_ToolTipCtrl .SetToolInfo(&ti); m_ToolTipCtrl .SendMessage (TTM_TRACKPOSITION, 0, MAKELPARAM(rect.right - 20, rect.CenterPoint().y)); m_ToolTipCtrl .SendMessage (TTM_TRACKACTIVATE, TRUE,reinterpret_cast(&ti)); this code i got from some post for more info follow this link http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/commctls/tooltip/usingtooltips.asp naren VC++ programmer

        U Offline
        U Offline
        ugur_basak
        wrote on last edited by
        #3

        narendra_ b; thank you very much for your help. I've been working on it for hours but couldn't find the solution. Your code works very good.

        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