ToolTips for Modal Dialog controls
Posted
by Aviad Tobaly
on February 1st, 1999
Changes to header files
private: HICON m_hIcon; CToolTipCtrl m_tool;
Add to implementation file
void CToolTipDlg::OnInitDialog()
{
// Create tooltip object
m_tool.Create(this);
// Add tooltip to the control
m_tool.AddTool(GetDlgItem(Dialog control ID here),tooltip as string);
// TRUE to show tooltips,FALSE to disable tooltips
m_tool.Activate(TRUE);
}
Using ClassWizard, implement the PreTranslateMessage member function and modify it as follows.
void CToolTipDlg::PreTranslateMessage(MSG* pMsg)
{
m_tool.RelayEvent(pMsg);
}
That's it! You now have tooltips on the controls!
Date Last Updated: February 1, 1999

Comments
There are no comments yet. Be the first to comment!