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 » Gradient Color in a set of Views under CTabView Collapse All
Subject Author Date
Alfonso Bastias Feb 17, 2011 - 1:35 PM

I create a new MFC project using VS2010, in order to use the new features (RIBBON, DOCK, TABVIEW)...


The CTabView have several views


 



innt



CMyTabView::OnCreate(LPCREATESTRUCT lpCreateStruct)

{

if (CTabView::OnCreate(lpCreateStruct) == -1)

    return -1;

pTab->ModifyTabStyle(CMFCTabCtrl::STYLE_3D_ONENOTE);

}


Each view has the OnPaint()


 



void


CMyView1::OnPaint()

{

CPaintDC dc(
this); // device context for painting

 


 


OnPrepareDC (&dc);

OnDraw(&dc);


 


}


 


I will like to have the gradient background matching with the color tab, however I am having a plain ligh gray. If I activate the Render the Hurricane, I got it the hurricane in a gray scale. no colors et all.


 


Your help is appreciate,


Regards,


Alfonso


 


 


if((! g_PaintManager->GetCb2DbTransparentMode( (CObject*)this )) 

|| 

(! g_PaintManager->PaintDockerBkgnd(
true, dc, (CWnd*)this ) ) )

{

  CRect rcClient; 

  GetClientRect( &rcClient ); 

  if( dc.RectVisible( &rcClient ) ) 

     dc.FillSolidRect(&rcClient,g_PaintManager->GetColor(CExtPaintManager::CLR_3DFACE_OUT));

}


CMFCTabCtrl* pTab = &GetTabControl();



AddView (RUNTIME_CLASS (CMyView1), _T(



"View 1"));

AddView (RUNTIME_CLASS (CMyView2), _T(
"View 2"));

....


}


///////////////////////////////////////////////



CMainFrame:CMainFrame()....

{...

    g_PaintManager->m_bCustomBackgroundInheritanceEnabled = true;

...


Alfonso Bastias Feb 17, 2011 - 1:44 PM

Uff, the last post was completely unformated and unorganized by the system...


in short..


I create a new project using VS2010.. added severals views with a CTabView... (OneNote Style...pTab->ModifyTabStyle(CMFCTabCtrl::STYLE_3D_ONENOTE);

)


I want to set the background colorung using a gradient color (matching with the color tab). I am getting just a lightgray background.


 


Thanks,


Alfonso

Technical Support Feb 18, 2011 - 2:53 AM