Picture objects

mjwilliamson used Ask the Experts™
I am trying to create a dialog which displays a
TabCtrl object which displays a different bitmap
image on each tab. I need to be able to set the
images at runtime, size to the bitmap and center in
the control tab in which it is placed.

WHat would be the best way of doing this, any
code to get me started appreciated. Kinda
new to all this MFC/C++ stuff.

Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
While there are many ways to do this, the way I usually do it using MFC would be via a CStatic class and an associated STATIC control on the dialog.

You can display BMP images using a STATIC control and changing the image can be done easily and at any time.


How can that be attached to the TabCtrl.

Or are you meaning use 1 static control and change
the bitmap according to the selected tab.

Do you have any example code?



I have the following but it does not display the

CStatic pic;
     pic.Create(_T(""),SS_BLACKRECT|WS_CHILD|WS_VISIBLE|SS_BITMAP, CRect (10,10,150,200), this, IDC_STATIC);
     pic.SetBitmap(::LoadBitmap(AfxGetApp()->m_hInstance, MAKEINTRESOURCE(IDB_BITMAP1)));

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial