It should work. I tested this on PropertyGrid Prof-UIS sample.
- I added this class in MainDlg.h, before CMainDlg class’s declaration:
class CMyPropertyGridCtrl : public CExtPropertyGridCtrl
{
public:
virtual void OnPgcInputComplete(
CExtPropertyGridWnd * pPGW,
CExtPropertyItem * pPropertyItem
)
{
ASSERT_VALID( this );
ASSERT_VALID( pPropertyItem );
CExtPropertyGridCtrl::OnPgcInputComplete(
pPGW,
pPropertyItem
);
if (pPropertyItem->ValueActiveGet() != NULL) {
DWORD dStyle = pPropertyItem->ValueActiveGet()->GetStyle();
if ( (dStyle & __EGCS_CHECKED) == __EGCS_CHECKED )
TRACE0("Checked\n");
else
TRACE0("UnChecked\n");
}
}
};
- Change
CExtPropertyGridCtrl m_PGC;
to
CMyPropertyGridCtrl m_PGC;
in CMainDlg class declaration.
- Add one line in CStarButtonProperty_File contsructor in MainDlg.cpp:
CStarButtonProperty_File::CStarButtonProperty_File(
CStarButton * pStarButton // = NULL
)
: CStarPropertyValueBase(
_T("File"),
pStarButton
)
{
...
ASSERT_VALID( pValue );
pValue->ModifyStyle(__EGCS_CHK_CHECK|__EGCS_ICA_VERT_CENTER); // added this line
ValueDefaultFromActive();
}
When running code and clicking on checkbox of file property, I can see the appropiate Checked/UnChecked lines appearing in VS Output Window. Try reproducing your problem in this sample or make a sample of your own to find out what’s wrong.