CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Guest

    ToolTips don't appear

    I am developing an application where the screen is changed several times without changing the view object. Because of this, I am adding and deleting tooltips constantly. Only problem is the tooltips refuse to appear.

    I do the following in OnInitialUpdate()

    void CViewTestView::OnInitialUpdate()
    {
    CScrollView::OnInitialUpdate();

    //code deleted

    EnableToolTips (TRUE);
    m_ToolTip.Create(this, TTS_ALWAYSTIP);
    }

    Later on I use the following code to add and delete the tooltips where CViewArea is defined as:



    class CViewArea
    {
    public:
    CViewArea();
    virtual ~CViewArea();

    CRect m_ViewGUILoc;
    CString m_strToolTip;
    };


    I call this function for each object that needs a tooltip is located on a screen change is found:
    void CViewTestView::CreateToolTips(CViewArea *viewData)
    {
    m_ButtonNum++;
    m_ToolTip.AddTool (this,viewData->m_strToolTip, viewData->m_ViewGUILoc, 1000 + m_ButtonNum);
    }

    On any screen change that occurs where the old screen had any tooltips, this function is called:

    void CViewTestView:eleteToolTips()
    {
    for (; m_ButtonNum > 0; m_ButtonNum--)
    m_ToolTip.DelTool (this, m_ButtonNum + 1000);
    }

    Whenever I pause over an area where a tooltip is suppose to pop up, nothing happens. Any help out there?

    Lynn Svedin


  2. #2
    Join Date
    Apr 1999
    Posts
    396

    Re: ToolTips don't appear

    On OnInitialUpdate(), call EnableToolTips AFTER you create them. That should work.


  3. #3
    Join Date
    May 1999
    Location
    WA
    Posts
    65

    Re: ToolTips don't appear

    Not only this, but you need to call m_Tooltip.Activate(TRUE/FALSE); right after your call to m_Tooltip.Create(this);

    Good luck!

    - Troy

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured