Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Can I add ToolTips in CPropertySheet?

74 views
Skip to first unread message

Kevin C. Chen

unread,
Jan 8, 1997, 3:00:00 AM1/8/97
to

Help!

Jeff,

Thanks for your help!

The followings are part of my codes:
<><><><><><><><><><><><><><><><><><><><><><><><><><><><>

BEGIN_MESSAGE_MAP(CMyPage, CPropertyPage)
ON_NOTIFY_EX( TTN_NEEDTEXT, 0, OnToolTipsNotify )
END_MESSAGE_MAP()

BOOL CMyPage::InitDialog()
{
.
.
//
// Add ToolTips!
//
BOOL bRet = EnableToolTips(TRUE);
return TRUE;
}

BOOL CMyPage::OnToolTipsNotify( UINT id, NMHDR * pNMHDR, LRESULT * pResult
)
{
TOOLTIPTEXT *pTTT = (TOOLTIPTEXT *)pNMHDR;
UINT nID =pNMHDR->idFrom;
if (pTTT->uFlags & TTF_IDISHWND)
{
// idFrom is actually the HWND of the tool
nID = ::GetDlgCtrlID((HWND)nID);
if(nID)
{
pTTT->lpszText = MAKEINTRESOURCE(nID);
pTTT->hinst = AfxGetResourceHandle();
return(TRUE);
}
}
return(FALSE);
}

/////////////////////////////////////
// CMySheet

CMySheet::CMySheet()
{
AddPage( &m_MyPage );
}

where CMySheet is derived from CPropertySheet and contains CMyPage as its
member (m_MyPage)

I set a breakpoint on CMyPage::OnToolTipsNotify(), but it didn't break at
the line! (I just wonder that it CANNOT show tooltips INSIDE a
CPropertySheet!)
This is my problem! Can you give me any suggestion? Thanks!!

Kevin

>
> Jeff Stong <Jeff_...@bio-rad.com> wrote in article
> <01bbfc9d$32932630$fd8865c0@jvs>...
> Kevin,
>
> Even though this isn't posted in an MFC section it sounds like you are
> using MFC (i.e. CPropertySheet). If you are using MFC see the "Tool
Tips"
> article in the "Programming with MFC: Encyclopedia" in your on-line
books.
>
> Hope this helps,
>
> Jeff
>
>
>

Jeremy Lloyd

unread,
Jan 10, 1997, 3:00:00 AM1/10/97
to

Kevin,

Looks ok, but you should be overriding OnInitDialog not InitDialog, unless
that was a typo.

I've been doing exactly the same thing as you today, and it does work. You
can have tooltips for controls in property pages in a property sheet. I
can't however figure how to get tooltips working for the buttons at the
bottom of the sheet.

Regards,
Jeremy.

Kevin C. Chen <ke...@lords.com> wrote in article
<01bbfdf0$5833f8c0$4c3a...@Kevin.umax.com.tw>...

0 new messages