Re: Remove white border across the Tab control
Just answered this for another poster... I'll cut and paste here... I've
never done this since I am happy with the standard colors, but ...
I think this is not a problem most of the time when people put dialogs on
the tab control since the border matches. To get around this, I think,
you'll have to do your own version of the tab control. This article might
help you:
http://www.codeguru.com/Cpp/controls/controls/tabcontrols/article.php/c2265
This one also looks interesting:
http://www.codeproject.com/wtl/tabbingframework.asp
http://www.codeguru.com/cpp/controls/controls/tabcontrols/article.php/c7407/
Tom
<nicetom786@yahoo.com> wrote in message
news:1150762853.102877.62380@i40g2000cwc.googlegroups.com...
I am implementing a tab sheet but I AM SEEING A WHITE BORDER around the
whole tab control which looks quite odd.
To remove the border I added the code in PreCreateWindow
cs.style &= ~WS_BORDER;
But this does not work.I also tried to override DrawItem but this does
not work either.
void CMainTabCtrl::DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct)
{
char szTabText[100];
TC_ITEM tci;
memset(szTabText, '\0', sizeof(szTabText));
tci.mask = TCIF_TEXT;
tci.pszText = (LPWSTR)szTabText;
tci.cchTextMax = sizeof(szTabText)-1;
GetItem(lpDrawItemStruct->itemID, &tci);
CDC *dc = CDC::FromHandle(lpDrawItemStruct->hDC);
CBrush backBrush(RGB(56, 56, 56));
dc->FillRect(&lpDrawItemStruct->rcItem, &backBrush);
dc->SetBkColor(RGB(56,56,56));
//dc->SetBkMode(TRANSPARENT);
dc->SetTextColor(RGB(255,255,255));
//dc->FillRect(&lpdis->rcItem, cbr);
// dc->SetBkColor(RGB(0,0,0));
TextOut(lpDrawItemStruct->hDC,
lpDrawItemStruct->rcItem.left,
lpDrawItemStruct->rcItem.top,
tci.pszText,
lstrlen(tci.pszText));
// TODO: Add your code to draw the specified item
// TODO: Add your code to draw the specified item
}
Pls guide