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 Tech Support » CExtResizableDialog Collapse All
Subject Author Date
Sergio Buonanno Mar 3, 2006 - 3:38 AM

Is there a way to have CExtResizableDialog not painting the background with a gradient (with VS 2005 visual style active) but with a solid color or a bitmap ?

Technical Support Mar 3, 2006 - 8:52 AM

You can just use CDialog rather than CExtResizableDialog. If you need to add anchoring support, simply apply the CExtWA template to the CDialog class.

Sergio Buonanno Mar 3, 2006 - 9:22 AM

That’s not exactly what I was looking for. I omitted an important detail; I need the gradient background when the application runs under Windows XP, but I don’t want it when it runs under Windows 2000 and to make the change you propose I have to change too much. I thought there was a property or method that could have made it much easier.

Thanks

Technical Support Mar 4, 2006 - 4:08 AM

In this case you need to override the WindowProc() virtual method like as follows:

LRESULT CTextComboGridDlg::WindowProc(UINT message, WPARAM wParam, LPARAM lParam) 
{
 if( ( message == WM_PAINT 
  || message == WM_ERASEBKGND
  || ( message >= WM_CTLCOLORMSGBOX && message <= WM_CTLCOLORSTATIC )
  )
  && bWin2000 
  )
 {
  return DefWindowProc(message, wParam, lParam);
 }
 
 return CExtResizableDialog::WindowProc(message, wParam, lParam);
}