Tooltip in popup tree control |
Post Reply |
Author | |
mgampi
Senior Member Joined: 14 July 2003 Status: Offline Points: 1201 |
Post Options
Thanks(0)
Posted: 20 November 2006 at 11:33am |
Hi;
I have troubles in displaying a tooltip within a popup tree control.
See attached image.
Any ideas whats wrong?
Martin
|
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
It is known CTreeCtrl problem.
here is code we use in CXTTreeCtrl to fix it:
BOOL CXTTreeBase::OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult)
{ NMHDR* pNMHDR = (NMHDR*)lParam; switch (pNMHDR->code)
{ case TTN_SHOW: { // get a pointer to the tooltip control. HWND hWnd = TreeView_GetToolTips(m_pTreeCtrl->m_hWnd); if (hWnd != NULL) { // make sure the tooltip is at the top of the "Z" order, otherwise // it will appear behind popup windows.... ::SetWindowPos(hWnd, HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE); } } break; } return m_pTreeCtrl->CTreeCtrl::OnNotify(wParam, lParam, pResult);
} |
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
mgampi
Senior Member Joined: 14 July 2003 Status: Offline Points: 1201 |
Post Options
Thanks(0)
|
Hi Oleg;
This happens with the CXTTreeCtrl! I'm not using the CTreeCtrl. I create the control in this way:
CXTTreeCtrl::CreateEx(WS_EX_TOOLWINDOW | (pParent->GetExStyle() & WS_EX_LAYOUTRTL), WS_CHILD | WS_BORDER | WS_VSCROLL | TVS_DISABLEDRAGDROP | TVS_TRACKSELECT, CRect(0, 0, 0, 0), pParent, 0) Am I missing any necessary style?
Martin
|
|
mgampi
Senior Member Joined: 14 July 2003 Status: Offline Points: 1201 |
Post Options
Thanks(0)
|
Hello Oleg; I took your reply as a hint and wrote my own OnNotify() function. After changing the flag for the second parameter of SetWindowPos to HWND_TOPMOST it works as expected. Here are my small changes in my treectrl class function OnNotify() (perhaps this changes should also go into your CXTReeCtrlBase class: if (hWnd != NULL) {
// make sure the tooltip is at the top of the "Z" order, otherwise // it will appear behind popup windows.... ::SetWindowPos(hWnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE); } Martin |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |