For example, the tab control is added to the right of the chessboard, making it look like a property page, but with white edges, it's pretty ugly:
It was later found that the owner Draw Fixed of the tab space was set to true. But again, the title text on the property page doesn't appear, and the result
Continue to search, the original need to CTabCtrl the DrawItem function, in fact, MFC is mandatory overloading, the actual operation process is as follows:
void Cmytabctrl::D rawitem (lpdrawitemstruct lpdrawitemstruct) {
Get tab text content
TCHAR sztabtext[100];
Tc_item TCI;
memset (Sztabtext, ' n ', sizeof (Sztabtext));
Tci.mask = Tcif_text;
Tci.psztext = Sztabtext;
Tci.cchtextmax = sizeof (Sztabtext)-1;
GetItem (Lpdrawitemstruct->itemid, &TCI);
Fill tab background
CDC *DC = Cdc::fromhandle (LPDRAWITEMSTRUCT->HDC);
Draw Tab Text
RECT RC;
rc=lpdrawitemstruct->rcitem;
rc.top+=3;
Dc->drawtext (Tci.psztext,lstrlen (Tci.psztext), &rc,dt_center);
}
After the completion of such as, it is more normal appearance:
Finally know how to make the tab control without the white edge of the method