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 14:17:45 GMT  
 Change tab color and background of Property sheet.

Quote:

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

I think that you can use CTabCtrl::AdjustRect() to get a display rectangle
from a window rectangle.

--
Excuse my poor English.

Ueta System Design Studio
http://www1.odn.ne.jp/usdesign/ (sorry, no English page)
UETA, Shin-ichi



Thu, 15 Dec 2005 14:55:45 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