"Balloon" tooltip

Source: Internet
Author: User

 

 

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 );

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.