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 » I want to appoint a color of a background of CExtResizableDialog. Collapse All
Subject Author Date
tera t Apr 23, 2007 - 10:38 PM

Hello

 I want to appoint a color of a background of CExtResizableDialog.
Please teach a way.

Thank You

Technical Support Apr 25, 2007 - 4:34 AM

If If you look at the declaration of CExtResizableDialog, you will see that its parent classes are wrapped in templates. A CExtWS template adds a theme-based background to the resizable dialog window by overriding the WindowProc() virtual method and handling the WM_PAINT message there. You can also override WindowProc() method and handle WM_PAINT there:

class C_Your_Dialog : public CExtResizableDialog
{
protected:
    virtual LRESULT WindowProc( UINT message, WPARAM wParam, LPARAM lParam )
    {
        if( message == WM_PAINT )
        {
            CPaintDC dc( this );
            // 
            // YOUR CUSTOM PAINTING CODE GOES HERE 
            //
            return 0;
        }
        return CExtResizableDialog::WindowProc( message, wParam, lParam );
    }
};
Please note that starting from v.2.62 you can get and set the background color using GetBkColor()/SetBkColor() methods of the CExtWS template.

Please also note that this background will not be consistent between controls anywhere inside the dialog. All the controls have its own background and you have to set the background color for all the controls manually or use the CExtPaintManager::g_nMsgPaintInheritedBackground registered message which allows painting a custom background that is consistent between controls.