Re: tooltip for controls on a dialog application
On Jan 21, 9:27 am, kathy <yqin...@yahoo.com> wrote:
I try to add tooltips for my controls on a dialog application.
in OnInitDialog(), I add :
EnableToolTips(TRUE);
Then I add ON_NOTIFY_EX(TTN_NEEDTEXT, 0, OnToolTipNotify) in message
map:
BEGIN_MESSAGE_MAP(CMFC_ZoomDlg, CDialog)
...
ON_NOTIFY_EX(TTN_NEEDTEXT, 0, OnToolTipNotify)
...
END_MESSAGE_MAP()
and:
BOOL CMFC_TestDlg::OnToolTipNotify( UINT unId, NMHDR *pstNMHDR,
LRESULT *pstResult )
{
UNUSED_ALWAYS (pstResult);
UNUSED_ALWAYS (unId);
TOOLTIPTEXT* pstTTT = (TOOLTIPTEXT * )pstNMHDR;
UINT nID = pstNMHDR->idFrom;
if ((pstTTT->uFlags & TTF_IDISHWND))
{
// idFrom is actually the HWND of the too=
l
nID = ::GetDlgCtrlID((HWND)nID);
pstTTT->lpszText = _T("Hello");
pstTTT->hinst = AfxGetResourceHandle();
return(TRUE);
}
return (FALSE);
}
On my dialog, I have some EditBox, RadioButton, Button ComboBox. But
some control show tooltips and others not. Could someone tell me why?
I find the controls with no tooltips are controls with tab order
bigger than the Group control tab order. How to set tooltips with any
tab order.