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 do you use the CToolTipCtrl?

How do you use the CToolTipCtrl?

Scheduled Pinned Locked Moved C / C++ / MFC
3 Posts 3 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.
  • N Offline
    N Offline
    Newbie
    wrote on last edited by
    #1

    Can somebody show me how to use the tool tip control in a dialog app? Could Microsoft have made this any harder?

    J J 2 Replies Last reply
    0
    • N Newbie

      Can somebody show me how to use the tool tip control in a dialog app? Could Microsoft have made this any harder?

      J Offline
      J Offline
      Jeremy Davis
      wrote on last edited by
      #2

      Create a member function in your head file... CToolTipCtrl m_ToolTips; then..... BOOL CJVFAccessDlg::PreTranslateMessage(MSG* pMsg) { // TODO: Add your specialized code here and/or call the base class switch(pMsg->message) { case WM_LBUTTONDOWN: case WM_LBUTTONUP: case WM_MOUSEMOVE: m_ToolTips.RelayEvent(pMsg); } return cdxCSizingDialog::PreTranslateMessage(pMsg); } BOOL CJVFAccessDlg::OnInitDialog() { m_ToolTips.Create(this); m_ToolTips.SetDelayTime(200); m_ToolTips.SetDelayTime(TTDT_AUTOPOP, 50000); m_ToolTips.SetMaxTipWidth(200); m_ToolTips.AddTool(GetDlgItem(IDD_REPORTS), winmesgs[7]); m_ToolTips.AddTool(GetDlgItem(IDD_PERSONNEL), winmesgs[8]); : : etc etc etc return TRUE; }

      1 Reply Last reply
      0
      • N Newbie

        Can somebody show me how to use the tool tip control in a dialog app? Could Microsoft have made this any harder?

        J Offline
        J Offline
        jschacker
        wrote on last edited by
        #3

        There are two MSDN documents that cover this: "How to Add Tooltips for Controls to an MFC Modal Dialog Box" (on the CD set) - and - "Tiptoe Through the ToolTips With Our All-Encompassing ToolTip Programmer's Guide" (http://msdn.microsoft.com/library/periodic/period97/S245A9.htm) Also, it is a good idea to put in an option to turn off tooltips in your dialog boxes. They can get annoying once you are familiar with using the application. Good Luck Jonathan Craig

        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