BCGControlBar Pro for MFC
virtual BOOL CBCGPComboBox::BCGPModifyStyle ( DWORD  dwRemove,
DWORD  dwAdd,
UINT  nFlags = BCGP_MODIFYSTYLE_ALL 
)
virtual

Recreates control with new styles.

Parameters
dwRemoveCombination of control styles to be removed.
dwAddCombination of control styles to be added.
nFlagsCombination of the following flags:
  • BCGP_MODIFYSTYLE_RESTORE_FOCUS: set focus to the new window if old one was focused before calling this method.
  • BCGP_MODIFYSTYLE_COPY_ITEMS: control items will be copied to the new control.
  • BCGP_MODIFYSTYLE_COPY_ITEM_DATA: control items data will be copied to the new control. You may override OnCopyItemData() method if you need to re-allocate the item data.
  • BCGP_MODIFYSTYLE_RESTORE_SELECTION: restore selected items in the new control.
  • BCGP_MODIFYSTYLE_ALL: combination of all flags above.
Returns
TRUE if control was successfully recreated; FALSE - otherwise.

Call BCGPModifyStyle() to recreate control with new styles. Due to Windows limitations, the standard ModifyStyle method doesn't allow to change some control styles such as "owner-draw" or "sorted". Please note, that window handle m_hWnd will be changed, therefore please don't use the previously saved value.