开发者

Subclassing tab control

开发者 https://www.devze.com 2023-01-19 13:22 出处:网络
What is the proper way to subclass a tab co开发者_开发百科ntrol in winAPI, having windows perform both the default drawing and your own. Because BeginPaint() and EndPaint() are calling within the defa

What is the proper way to subclass a tab co开发者_开发百科ntrol in winAPI, having windows perform both the default drawing and your own. Because BeginPaint() and EndPaint() are calling within the default proc, I don't see a way to do this. I did get it working with GetDC(), but it had a very bugs which annoyed the hell out of me.

If what I am asking is impossible, what is the best way to draw the tabs by myself?


Subclassing is not required in your situation. The tab control supports the TCS_OWNERDRAWFIXED style bit, which allows its parent window to handle WM_DRAWITEM messages and draw the tabs itself.

There's a nice exemple on Codeguru. It uses MFC but don't let that stop you. Check out their CTabCtrlEx::DrawItem() method.

0

精彩评论

暂无评论...
验证码 换一张
取 消