|
-
February 22nd, 2000, 12:21 PM
#1
ToolTips
I need to create ToolTips in DialogBox
My Dialog box contains:
1)PushButtons
2)CheckBoxes
3)ComboBoxes
I've done such thing:
1)
BOOL CMyDialogBox::OnInitDialog()
{
......
......
EnableToolTips(true)
......
}
2)
BEGIN_MESSAGE_MAP (CMyDialog, CDialog)
.....
.....
ON_NOTIFY_EX(TTN_NEEDTEXT,0,OnTTip)
END_MESSAGE_MAP()
3)
BOOL CMyDialog::OnTT(UINTidFrom,NMHDR*hdr,LRESULT *ResultNotUsed)
{
TOOLTIPTEXT *pTTT = (TOOLTIPTEXT *)hdr;
UINT nID = pTTT->hdr.idFrom;
pTTT -> lpszText = "TEST";
return(true);
}
It works for PUSH BUTTONS ONLY
But it dosen't work for comboboxes,lables and checkboxes.
Please help me.
Thank you.
Alex
-
February 22nd, 2000, 12:36 PM
#2
Re: ToolTips
While there isn't a better answer, see if this helps:
http://mfcfaq.stringray.com/
--
Nuno Tavares
http://nthq.cjb.net
Nuno Tavares
"I live the way I type: fast, with a lot of errors"
-
February 28th, 2000, 12:27 PM
#3
Re: ToolTips
Ther is some mistake I can't enter this www :-(
-
February 28th, 2000, 03:26 PM
#4
Re: ToolTips
It works on NT…
Try this (from my test program):
BOOL CToolTipsDlg::OnTTip(UINT id, NMHDR* pNMHDR, LRESULT *pResult)
{
TOOLTIPTEXT *pTTT = (TOOLTIPTEXT*)pNMHDR;
UINT nID = pNMHDR->idFrom;
if ((pNMHDR->code == TTN_NEEDTEXT) && (pTTTA->uFlags & TTF_IDISHWND)
{
// idFrom is the HWND of the tool
nID = ::GetDlgCtrlID((HWND)nID);
}
pTTT->lpszText = "TEST";
return TRUE;
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|