Finally know how to make the tab control without the white edge of the method

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.