Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS General Discussion » Update text in CExtPropertyGridComboBoxBar Collapse All
Subject Author Date
Pablo van der Meer Oct 26, 2006 - 7:32 AM

Is there a safe way to update the text an (selected) item in a CExtPropertyGridComboBoxBar?
Is the follwing code safe to do?


// nPos is the current selection
CExtPropertyStore *pPS = pCBB->PropertyStoreGetAt(nPos);

// suppress CtlColor call which causes an assert!
pCBB->SetRedraw(FALSE);
pCBB->PropertyStoreRemove(nPos);
pCBB->PropertyStoreInsert(pPS, nPos);
pCBB->SetCurSel(nPos);

// update changes
pCBB->SetRedraw(TRUE);
pCBB->RedrawWindow();

Technical Support Oct 26, 2006 - 12:38 PM

Your code is safe. The property grid control and all its parts never delete property stores. The property store which is removed in from the combo box can be displayed in the property grid control, but you select the new property store immediately. So, you could even delete the removed property store from memory after invoking this code.