Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How I can get a "tip" in VC++?? 1

Status
Not open for further replies.

Bartec

Programmer
Jan 21, 2005
54
PL
Hi!

I need to get a tip information when I move coursor over a button. I know how to do this in List Control but don't know how to show a tip from a button

Thanks for reply.

Best
Bartek
 
in your class's header file make a variable of type CToolTipCtrl. For instance:

Code:
CToolTipCtrl m_ToolTips;

Then in your dialog's OnInitDialog() or CFormView's OnInitialUpdate():

Code:
m_ToolTips.Create(this);
		m_ToolTips.SetDelayTime(100);
		m_ToolTips.AddTool(&m_cmdZoom1,_T("See larger version of this text."));

In the above example, 'm_cmdZoom' is the name of a CButton variable that is mapped to a button on my dialog. Then just call m_ToolTips.AddTool() like this for each control, passing it the address of your CButton object. You only need one CToolTipCtrl variable for your whole form, and it will accomodate all the controls you add to it. Easy, wasn't it? Hope this helped.

BlackDice

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top