Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Owner Drawn CTabCtrl SetItemSize does not work?

402 views
Skip to first unread message

rockdale

unread,
Jan 16, 2009, 4:04:40 PM1/16/09
to
Hi, all:

I am trying to create an owner drawn CTabCtrl to change the background
color, tab item font...etc. I have been using
http://www.codeguru.com/cpp/controls/controls/tabcontrols/article.php/c2237/
as reference for change tab item text font. But I find a problem, when
I set a larger font size, the text font changed but the tab item size
remains the original size. Even if I set its new size, it only changes
the height, not the width. Anybody had this problems before, any help
is very much appreciated.

//my code snippet is as following

CSize newSize(400,48); //change 400 to bigger number does do
any difference
m_tabCtrl.SetItemSize(newSize);

CFont font;
font.CreateFont(-8, 0, 0, 0, 700,0,0,0,1,0,0,0,0,_T("Arial"));
m_tabCtrl.SetFont(&font);

Thanks in advance
-rockdale


Seetharam

unread,
Jan 16, 2009, 6:27:27 PM1/16/09
to
Some googling showed me this link:

http://www.codeproject.com/KB/tabs/customtab.aspx?msg=890365#xx890365xx

SetItemSize() seems to work for changing vertical height only. For
horizontal width, 'SetMinTabWidth()" seems to work OK.

-SM

0 new messages