Print Page | Close Window

Tab key

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Property Grid
Forum Description: Topics Related to Codejock Property Grid
URL: http://forum.codejock.com/forum_posts.asp?TID=343
Printed Date: 23 November 2024 at 7:02am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Tab key
Posted By: Italo
Subject: Tab key
Date 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




Replies:
Posted By: Italo
Date 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();
    }




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net