当前位置: 动力学知识库 > 问答 > 编程问答 >

c++ - How to make the ToolTip appear in the foreground of the floating CPaneDialog?

问题描述:

Does anybody has a hint for the following problem?

I have a derived class from CPaneDialog, it contains just one button. I want to show a tooltip if the mouse is over it. For this I use CMFCToolTipCtrl:

// Create the ToolTip control.

m_ToolTip.Create(this, TTS_ALWAYSTIP | TTS_NOPREFIX);

m_ToolTip.Activate(TRUE);

CMFCToolTipInfo params;

params.m_bVislManagerTheme = TRUE;

m_ToolTip.SetParams(&params);

m_ToolTip.AddTool(GetDlgItem(IDC_BUTTON1), _T("Here is the text of my tooltip message."));

The m_ToolTip.RelayEvent(pMsg) I call from PreTranslateMessage().

If i compile and run the application, it looks like on the image below: The tooltip appears in the background of my pane!

ToolTipOnPane http://img268.imageshack.us/img268/9926/tooltiponpanedialog.png

网友答案:

set the topmost property.

m_ToolTip.SetWindowPos(&CWnd::wndTopMost, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
分享给朋友:
您可能感兴趣的文章:
随机阅读: