1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Displaying a tooltip for a ComboBox

Discussion in 'MFC' started by nlraley, Jul 20, 2010.

  1. nlraley

    nlraley New Member

    Jul 20, 2010
    Likes Received:
    Trophy Points:
    I'm displaying tooltips for controls in my dialog based application written with MFC like this:

    1. Using CToolTipCtrl ToolTips; class object

    2. Add tooltips to controls like this:
    CWnd* pDialogCtrlWnd = GetDlgItem(ID_COMBOBOX1);
    ToolTips.AddTool(pDialogCtrlWnd, pTooltipText);
    3. And then process them:
    BOOL CMyDlg::PreTranslateMessage(MSG* pMsg)
    	// TODO: Add your specialized code here and/or call the base class
    	//Tooltip management
    	return CDialog::PreTranslateMessage(pMsg);
    This scheme seems to work fine, except when I try to add a tooltip to a dropdown ComboBox control. It gets displayed for the button part of the combo box only. I know that the combo box houses an edit control internally, so I tried to use that edit control's HWND handle for adding a tooltip but that didn't help either.

    How do I need to change this code to make it work for a combo box?

Share This Page