Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Property Grid
  New Posts New Posts RSS Feed - Tab key
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Tab key

 Post Reply Post Reply
Author
Message
Italo View Drop Down
Groupie
Groupie


Joined: 10 December 2003
Location: United States
Status: Offline
Points: 83
Post Options Post Options   Thanks (0) Thanks(0)   Quote Italo Quote  Post ReplyReply Direct Link To This Post Topic: Tab key
    Posted: 09 January 2004 at 7:04am

How can I make the control forward the tab key to the dialog? I want to move the focus to the next control, when the tab key is pressed.

Thanks, Italo



Edited by Italo
Back to Top
Italo View Drop Down
Groupie
Groupie


Joined: 10 December 2003
Location: United States
Status: Offline
Points: 83
Post Options Post Options   Thanks (0) Thanks(0)   Quote Italo Quote  Post ReplyReply Direct Link To This Post Posted: 09 January 2004 at 8:34am

In PropertyGrid\XTPPropertyGridInplaceEdit.cpp change line 222 to

    CWnd* pParent = GetAncestor(GA_ROOT);

    and line 233 to

    CWnd* pWndNext = pParent->GetNextDlgTabItem(m_pGrid, (GetKeyState(VK_SHIFT) < 0));

 

Add the following function to PropertyGrid\XTPPropertyGridView.cpp

void CXTPPropertyGridView::_ForwardFocus()
{
    CWnd* pRoot = GetAncestor(GA_ROOT);
    CWnd* pWndNext = pRoot->GetNextDlgTabItem(m_pGrid, (GetKeyState(VK_SHIFT) < 0) );
    if (pWndNext != NULL)
    {
        pWndNext->SetFocus();
    }
}

 

Add the folloing lines to CXTPPropertyGridView::OnKeyDown

    if (nChar == VK_TAB && (!pItem || pItem->IsCategory()) )
    {
        _ForwardFocus();
    }

Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.156 seconds.