开发者

Placing Tab Control at runtime issue in MFC

开发者 https://www.devze.com 2023-01-18 14:01 出处:网络
I am loading background image at runtime in my MFC Application. Like this : m_objMainScrnDC.CreateCompatibleDC(NULL);

I am loading background image at runtime in my MFC Application. Like this :

m_objMainScrnDC.CreateCompatibleDC(NULL);
        m_objMainScrnBgBitmap.LoadBitmap(IDB_MAIN_SCRN_BG); 

And i have tabcontrol on my page at design time , now i want to place a background image for tab control at runtime but i am not able to get that image The tabcontrol is on top of background image w开发者_StackOverflowhich i have loaded at run time.

    m_objTabDC.CreateCompatibleDC(NULL);
m_objTabBitmap.LoadBitmap(IDB_TAB_BG);

How i can achieve this ?


My MFC is pretty rusty, but I think I remember that it involved creating a brush with your image and having MFC use it when the window gets redrawn (was it OnPaint()? OnRedraw()?).

I googled a bit and found this: http://www.codeproject.com/KB/MFC/UltimateToolbox_Skins.aspx Not exactly what you want, but the source is there and I'm sure it can lead you in the right direction. Also, if it looks like "too much work just to get a background image" then you're right. MFC did so little for programmers out of the box that every simple thing required a ton of work and effort on our part.

0

精彩评论

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

关注公众号