Professional UI Solutions
Site Map   /  Register


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 Tech Support » Change background color of GridCell when the user changed the theme Collapse All
Subject Author Date
Ulrich Heinicke Mar 11, 2009 - 3:09 PM


when a CEdit control will be disabled the background color will be changed. So i want to have the same when a CExtGridCell will be readonly. So i insert the following code into my class:


    if (bReadOnly)
        GridCellGet(nColNo, nRowNo)->ModifyStyle(__EGCS_NO_INPLACE_CONTROL);
        GridCellGet(nColNo, nRowNo)->BackColorSet(CExtGridCell::__ECS_NORMAL, 
           g_PaintManager->GetColor(CExtPaintManager::CLR_3DFACE_IN, (CObject*)this);


 When the user change the theme maybe from Office2007 LunaBlue to Native Windows XP then grid will be redrawn. But the color of the readonly cells are the same. Only after a restart they are different. My question is: Is there an event that i can used to redraw the readonly cells or do you have another idea to handle that without restart the application?



Technical Support Mar 13, 2009 - 3:39 PM

It’s not effective to reset colors of all the cells when the UI theme is changed. Please do not assign any colors to grid cells. You should simply implement the CExtScrollItemWnd::OnSiwGetReadOnlyTextColor() and CExtScrollItemWnd::OnSiwGetReadOnlyBackgroundColor() virtual methods in your grid class and return the required colors of read only grid cells.

Ulrich Heinicke Mar 13, 2009 - 4:45 PM

Thanks, it works.