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. tool tips

tool tips

Scheduled Pinned Locked Moved C / C++ / MFC
tutorial
6 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.
  • V Offline
    V Offline
    vivekphlp
    wrote on last edited by
    #1

    I have several Edit boxes in my dialog application.. Can any one tell me how to create tool tips for each of the edit boxes...

    Proud To Be an Indian

    H M V 3 Replies Last reply
    0
    • V vivekphlp

      I have several Edit boxes in my dialog application.. Can any one tell me how to create tool tips for each of the edit boxes...

      Proud To Be an Indian

      H Offline
      H Offline
      Hamid Taebi
      wrote on last edited by
      #2

      See CPPToolTip v2.1[^] is your answer?


      WhiteSky


      V 1 Reply Last reply
      0
      • H Hamid Taebi

        See CPPToolTip v2.1[^] is your answer?


        WhiteSky


        V Offline
        V Offline
        vivekphlp
        wrote on last edited by
        #3

        m_ToolTip.Create(this); m_ToolTip.AddTool(GetDlgItem(IDC_CC_BODY_LENGTH_MIN),"Min Body Lenght"); m_ToolTip.AddTool(GetDlgItem(IDC_CC_BODY_LENGTH_MAX),"Max Body Lenght"); m_ToolTip.AddTool(GetDlgItem(IDC_CC_BODY_LENGTH_VAR),"Max Var Body Lenght"); m_ToolTip.Activate(TRUE); I had given like this in my code - where IDC_CC_BODY_LENGTH_MIN,IDC_CC_BODY_LENGTH_MIN,IDC_CC_BODY_LENGTH_VAR -are edit boxes - But the appln is running into a MEMORY ERROR , Why?

        Proud To Be an Indian

        H 1 Reply Last reply
        0
        • V vivekphlp

          m_ToolTip.Create(this); m_ToolTip.AddTool(GetDlgItem(IDC_CC_BODY_LENGTH_MIN),"Min Body Lenght"); m_ToolTip.AddTool(GetDlgItem(IDC_CC_BODY_LENGTH_MAX),"Max Body Lenght"); m_ToolTip.AddTool(GetDlgItem(IDC_CC_BODY_LENGTH_VAR),"Max Var Body Lenght"); m_ToolTip.Activate(TRUE); I had given like this in my code - where IDC_CC_BODY_LENGTH_MIN,IDC_CC_BODY_LENGTH_MIN,IDC_CC_BODY_LENGTH_VAR -are edit boxes - But the appln is running into a MEMORY ERROR , Why?

          Proud To Be an Indian

          H Offline
          H Offline
          Hamid Taebi
          wrote on last edited by
          #4

          Try to this code

          void CDialogDlg::SetToolTip(LPCTSTR Text,HWND hwnd)
          {
          TOOLINFO ti;
          ti.cbSize = sizeof(TOOLINFO);
          ti.lpszText = (LPTSTR)Text;
          ti.hinst = AfxGetInstanceHandle();
          ti.hwnd = hwnd;
          ti.uFlags = TTF_SUBCLASS | TTF_IDISHWND;
          ti.uId = (UINT) hwnd;

          m_tooltip.SendMessage(TTM_ADDTOOL, 0, (LPARAM) &ti);
          }

          void CDialogDlg::OnBnClickedButton1()
          {
          m_tooltip.Create(this);
          SetToolTip("Test",hwnd);
          SetToolTip("Test2",hwnd2);
          }

          What happens?


          WhiteSky


          1 Reply Last reply
          0
          • V vivekphlp

            I have several Edit boxes in my dialog application.. Can any one tell me how to create tool tips for each of the edit boxes...

            Proud To Be an Indian

            M Offline
            M Offline
            Manoj Kumar Rai
            wrote on last edited by
            #5

            Hi, Drive from the CEdit class and create a new CEditTool class, which will support the ToolTip. In Drived class CEditToolTip, have a member of type CToolTipCtrl. Create the Instance of this member in constructor, also u can set the ToolTipText Dynamically. And Finally in the MouseMove event u can call Update to display the tooltip.

            Manoj Never Give up

            1 Reply Last reply
            0
            • V vivekphlp

              I have several Edit boxes in my dialog application.. Can any one tell me how to create tool tips for each of the edit boxes...

              Proud To Be an Indian

              V Offline
              V Offline
              vivekphlp
              wrote on last edited by
              #6

              In my program i created an public variable CToolTipCtrl m_tooltip in the *.h file of my prg. WHen i changed the var declaration to protected the error was cleared protected: CToolTipCtrl m_tooltip; Frndz For information there is an easy way to create tooltips {Bosses plz excuse its for beginners} Projects->Add to Project->Components & controls ->Gallery->Visual C++ Components->ToolTip Support Its DONE .. . so simple

              Proud To Be an Indian

              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