This Program introducesCToolTipCtrl is similar to CTooolTipWnd and is used to implement the "balloon" tooltip.
The method for using this class is as follows:
1. Add ToolTipWnd. cpp to the project file.
2. Add # include "ToolTipWnd. h" to the header file ".
3. Add the following in the class declaration:
CToolTipWnd m_BalloonToolTip;
3. Add the following code in OnInitDialog (dialog box) or OnInitialUpdate (Form view:
M_BalloonToolTip.Create (this );
M_BalloonToolTip.AddTool (GetDlgItem (<id>), <text>, [text color]);
Eg.
M_BalloonToolTip.AddTool (GetDlgItem (IDC_EDIT1), "Tooltip", RGB (255, 0, 0 ));
The third parameter is optional. The default value isRGB (0, 0, 0 ). You can use SetDefTextColor to set the default text color.
4. Reload PreTranslateMessage and add the following code:
If (m_BalloonToolTip)
M_BalloonToolTip.RelayEvent (pMsg );