JOG
JOG

Reputation: 5640

CTabCtrl SetItemRect?

I want to change the size of the tabs.

We have added a closing cross to our tabs, but it conflicts spaciously with the text of the tab.

enter image description here

So far I have realized the following:

This is where I custom draw the contents of the tab, but I cannot resize them here:

LRESULT CSkinnedTabCtrl::WindowProc(UINT message, WPARAM wParam, LPARAM lParam) 
{
switch (message) {
    case WM_PAINT: {
        ...

        CPaintDC dc(this); 

        INT nCount = GetItemCount();

        for (INT i = 0; i < nCount; i++) {
            CRect rc;
            GetItemRect(i, rc);
            DrawItem(dc, i, rc);
        }

        return TRUE;
    }

Where do I set the size of the tabs, and how?

Upvotes: 2

Views: 769

Answers (1)

Reneg
Reneg

Reputation: 1

IIRC you need to overwrite WM_NCCALCSIZE message.

Upvotes: 0

Related Questions