Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Property Grid
  New Posts New Posts RSS Feed - Select GridItem from mainfrm programmatically
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Select GridItem from mainfrm programmatically

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


Joined: 24 September 2007
Status: Offline
Points: 41
Post Options Post Options   Thanks (0) Thanks(0)   Quote andrewg Quote  Post ReplyReply Direct Link To This Post Topic: Select GridItem from mainfrm programmatically
    Posted: 25 February 2008 at 10:07am
I'm currently attempting to select a propertygrid Item from the mainfrm and set the cursor in the item so the user doesn't have to move the mouse over and click into it. It's not quite working. The item is being selected but the cursor is not appearing.

MainFrm:

m_userPropertySheet->m_propertyGrid.SetFocus();
m_userPropertySheet->OnNew();


PropertySheet:

void CPropertySheet::OnNew() {
...
pItem = m_propertyGrid.GetCategories()->GetAt(0)->GetChilds()->GetAt(0);

pItem->Select();
pItem->GetInplaceEdit().SetFocus();
...
}


Anyone know how to get this to work?

Back to Top
Barto View Drop Down
Groupie
Groupie


Joined: 27 February 2005
Location: Germany
Status: Offline
Points: 60
Post Options Post Options   Thanks (0) Thanks(0)   Quote Barto Quote  Post ReplyReply Direct Link To This Post Posted: 27 February 2008 at 10:31am
maybe try something like this:
 

    pGrid->SetFocus();
    pGrid->SetCurSel(nIndex);
    pGrid->OnSelectionChanged();
    pItem = pGrid->GetItem(nIndex);
    pItem->OnSelect();
    pItem->SetFocusToInplaceControl();
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.172 seconds.