![]() |
TreeCtrl & EditControl & Acceleator Keya |
Post Reply
|
| Author | |
jimmy
Senior Member
Joined: 11 November 2003 Location: Austria Status: Offline Points: 516 |
Post Options
Thanks(0)
Quote Reply
Topic: TreeCtrl & EditControl & Acceleator KeyaPosted: 12 October 2004 at 10:21am |
|
The TreeCtrl don't handle accelerator key.
If i was in the edit-control of the treectrl and press a accelerator key, no accelerator message will received to the mainframe. BOOL CXTTreeBase::PreTranslateMessage(MSG* pMsg) { if (pMsg->message == WM_KEYDOWN) { // ensure that keystrokes are handled by the edit control. if (HasEditLabels() && m_pTreeCtrl->GetEditControl()) { ::TranslateMessage(pMsg); ::DispatchMessage(pMsg); return TRUE; } // toggle expand / contract when return key is hit. if (pMsg->wParam == VK_RETURN) { HTREEITEM htItem = m_pTreeCtrl->GetSelectedItem(); if (htItem != NULL) { m_pTreeCtrl->Expand(htItem, TVE_TOGGLE); } } } return m_pTreeCtrl->CTreeCtrl::PreTranslateMessage(pMsg); } |
|
![]() |
|
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 |