Tab Control tab border


2004-10-26 11:29:19 AM
cppbuilder47
I Have a Tab Control set to owner draw.
void __fastcall TForm1::TabControl1DrawTab(TCustomTabControl *Control, int TabIndex, const TRect &Rect, bool Active)
{
HDC Hdc = TabControl1->Canvas->Handle;
BitBlt(Hdc, Rect.Left, Rect.Top,
Rect.Width(), Rect.Height(),
Image1->Canvas->Handle,
Rect.left, Rect.Top,
SRCCOPY);
SetBkMode(Hdc, TRANSPARENT);
RECT R = static_cast<RECT>(Rect);
AnsiString text(TabControl1->Tabs->Strings[TabIndex]);
DrawText(Hdc, text.c_str(), text.Length(),
&R, DT_CENTER | DT_VCENTER | DT_SINGLELINE);
}
The Image comtrol is correctly populated. The text and background are drawn correctly. But I end up with a grey Border around the tab. How do I get rid of that?
John.