How to add tooltips for controls to an MFC modal dialog box (141758)
The information in this article applies to:
- The Microsoft Foundation Classes (MFC), when used with:
- Microsoft Visual C++, 32-bit Editions 2.1
- Microsoft Visual C++, 32-bit Editions 2.2
- Microsoft Visual C++, 32-bit Editions 4.0
- Microsoft Visual C++, 32-bit Editions 4.1
- Microsoft Visual C++, 32-bit Enterprise Edition 4.2
- Microsoft Visual C++, 32-bit Enterprise Edition 4.2b
- Microsoft Visual C++, 32-bit Enterprise Edition 5.0
- Microsoft Visual C++, 32-bit Enterprise Edition 6.0
- Microsoft Visual C++, 32-bit Professional Edition 4.2
- Microsoft Visual C++, 32-bit Professional Edition 4.2b
- Microsoft Visual C++, 32-bit Professional Edition 5.0
- Microsoft Visual C++, 32-bit Professional Edition 6.0
- Microsoft Visual C++, 32-bit Learning Edition 6.0
- Microsoft Visual C++ .NET (2002)
This article was previously published under Q141758 SUMMARY
To make the CToolTipCtrl class work correctly, you must call the
CToolTipCtrl::RelayEvent function. When you use this function, the
mouse messages can be passed to the tooltip control.
For a non-modal dialog box window in an MFC application, use the window's
CWnd::PreTranslateMessage function to call the CToolTipsCtrl::RelayEvent function.
However, for a modal dialog box in MFC versions earlier than version 4.0, the
CDialog::PreTranslateMessage function is not called because modal dialog
boxes have their own message loops.
In MFC 4.0 and later versions, this is not a problem because of changes
to the implementation of DoModal. Therefore, to use the CToolTipCtrl class in a modal
dialog box, you must use a different approach for versions earlier than 4.0. This
article gives you step-by-step examples that show you how to use the
CToolTipCtrl class in an MFC modal dialog box for MFC 4.0 and earlier versions.
Modification Type: | Major | Last Reviewed: | 4/27/2005 |
---|
Keywords: | kbcode kbDlg kbhowto kbToolTip KbUIDesign KB141758 kbAudDeveloper |
---|
|