Change tab color and background of Property sheet. 
Author Message
 Change tab color and background of Property sheet.

Hi, everyone.

I have a difficult about Propertysheet.
I'm trying to change color of Properysheet.
First of all, I made a derived TabCtrl class to change Tab color.
This is my source.
If I use the function FillSolidRect(...), Propertysheet is filled with my
assigned color.
Unfortunatly, I can't see second and thrid tab.
After I click those position, I can see that.
If I don't use that function, can see all tabs.
Are there any good man to give me a perfect solution for this one?

Thanks.

void CTabCtrlEx::DrawItem(LPDRAWITEMSTRUCT lpDIS)
{
     CRect the_r = lpDIS->rcItem;
     CBrush the_br(RGB(0,0,0));
     CDC* the_dc = CDC::FromHandle(lpDIS->hDC);

     the_dc->SelectObject(the_br);
     the_dc->SetTextColor(MFV_COLOR_CTRL_TEXT);

     CRect rect;
     GetClientRect(&rect);
     the_dc->SetBkColor(MFV_COLOR_BACK);
     the_dc->FillSolidRect(rect, MFV_COLOR_BACK);// <- This is a big
problem.

     the_r.top= the_r.top +3;
     if(lpDIS->itemID ==0)
     {
         the_dc->SetBkColor(MFV_COLOR_BACK);
         the_dc->DrawText("General",the_r,1);
     }

     if(lpDIS->itemID ==1)
     {
         the_r.left=the_r.left-2;
         the_dc->SetBkColor(MFV_COLOR_BACK);
         the_dc->DrawText("Quality Control",the_r,1);
     }

     if(lpDIS->itemID ==2)
     {
         the_r.left=the_r.left-2;
         the_dc->SetBkColor(MFV_COLOR_BACK);
         the_dc->DrawText("Advanced",the_r,1);
     }

     the_dc->DeleteTempMap();

Quote:
}



Thu, 15 Dec 2005 21:19:30 GMT  
 Change tab color and background of Property sheet.

Quote:

> Hi, everyone.

> I have a difficult about Propertysheet.
> I'm trying to change color of Properysheet.
> First of all, I made a derived TabCtrl class to change Tab color.
> This is my source.
> If I use the function FillSolidRect(...), Propertysheet is filled with my
> assigned color.
> Unfortunatly, I can't see second and thrid tab.
> After I click those position, I can see that.
> If I don't use that function, can see all tabs.
> Are there any good man to give me a perfect solution for this one?

> Thanks.
> <code...>

You are painting the entire rect returned from GetClientRect.  So you
are painting over the entire tab control, including the area with the
tabs.  Make your rect smaller by calling the tab control's AdjustRect
function.

--
Scott McPhillips [VC++ MVP]



Thu, 15 Dec 2005 22:39:21 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Change tab color and background of Property sheet.

2. How to change the color of the tab on a property sheet

3. changing tab control color in property sheet

4. changing tab control color in property sheet

5. Property sheets: Changing [tab] to [alt][tab]?

6. property sheet background color

7. property sheet background color

8. change property sheet color?

9. how to change the color for property sheet

10. Problems changing the color of a property sheet

11. change background color of a property page

12. Q: Set Tab Window Text in Property Page/Property Sheet

 

 
Powered by phpBB® Forum Software