Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Display a tool-tip!!!

Posted on 1999-10-06
2
Medium Priority
?
228 Views
Last Modified: 2013-11-20
Dear All,

I want to know how to display a tooltip when I have moved the mouse over a button.
The button control is placed at the dialog.....and this dialog will be used at the CFormView class......

How can I impelemnt a tooltip in this suitation?

Thanks!!!
0
Comment
Question by:ee_lcpaa
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
2 Comments
 
LVL 3

Accepted Solution

by:
VCGuru earned 150 total points
ID: 2102740
class CMyFormView:public CFormView
{
....
CButton m_button;
//use class wizard to add m_button
....
CToolTipCtrl m_ToolTip;
};

in the .cpp
Override PreTranslateMessage

BOOL CMyFormView::PreTranslateMessage(...)
{
m_ToolTip.RelayEvent(pMsg);
return CFormView::PreTranslate...
}

void CMyFormView::OnInitialUpdate()
{
...
if(!m_ToolTip.Create(this))
{
//error
return;
}
m_ToolTip.AddTool(&m_button,IDC_BUTTON);
//where IDC_BUTTON is the ID of the button

m_ToolTip.Activate(TRUE);
}

That's it.
0
 
LVL 3

Expert Comment

by:VCGuru
ID: 2102751
oops messed up...
In the above answer IDC_BUTTON is NOT THE ID of the button.

What you have to do is use the resource editor to define string resources for each control. If my button needs a tooltip "MyButton" then IDS_MYTOOL would be defined as "MyButton". The AddTool function in the above answer would be.

m_ToolTip.AddTool(&m_button,IDS_MYTOOL );

Sorry for the inconvinience
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

721 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question