April 10th, 1999, 06:13 PM
Hi! I'm trying to implement CTabCtrl in a dialog I have. I used the resource editor to insert a CTabCtrl into my dialog. I created dialogs and classes for the various pages and everything along those lines work. The only problm I've ran into now is that I can't get any images to appear on the tabs. There's even an example here of how to do it but it's not working for me. What happens is that the tabs get shaped the correct size (so it must know about the bitmaps in the imagelist) but the tab is empty. Here's some code I use when adding the tab:
TC_ITEM TabCtrlItem;
TabCtrlItem.mask = TCIF_IMAGE;
TabCtrlItem.pszText = "Quality";
TabCtrlItem.iImage = 0;
If I do a | TCIF_TEXT I'll see the text just fine on the tab, but still no image. So my images just aren't showing up. NO idea where to go from here. I've tried setting the "Owner Draw Fixed" button (which you have to do for CBitmapButtons, Owner Draw) but that makes me get an access violationb in the MFC dll, with none of my code in the call stack.
So I'm lost.:)
Here's more of the init code:
CImageList test;
test.Create( IDB_FEATURE_MENU, 70, 0,RGB(255,255,255));
m_tab.SetImageList(&test);
// Create a CImageList and associate this somehow to the tab control
// Then specify the image index for each item
TC_ITEM TabCtrlItem;
TabCtrlItem.mask = TCIF_IMAGE;
TabCtrlItem.pszText = "Quality";
TabCtrlItem.iImage = 0;
m_tab.InsertItem( 0, &TabCtrlItem );
TabCtrlItem.iImage = 1;
TabCtrlItem.pszText = "Finish";
m_tab.InsertItem( 1, &TabCtrlItem );
TabCtrlItem.iImage = 2;
TabCtrlItem.pszText = "Paper";
m_tab.InsertItem( 2, &TabCtrlItem );
TabCtrlItem.iImage = 3;
TabCtrlItem.pszText = "NiceStuff";
m_tab.InsertItem( 3, &TabCtrlItem );
mQuality.Create(IDD_MOP_QUALITY, &m_tab);
mFinish.Create(IDD_MOP_FINISH, &m_tab);
mPaper.Create(IDD_MOP_PAPER, &m_tab);
Thanks for any help you can offer!
You can reach me at: ivan@wrinkled.com
I'll check here too.
TC_ITEM TabCtrlItem;
TabCtrlItem.mask = TCIF_IMAGE;
TabCtrlItem.pszText = "Quality";
TabCtrlItem.iImage = 0;
If I do a | TCIF_TEXT I'll see the text just fine on the tab, but still no image. So my images just aren't showing up. NO idea where to go from here. I've tried setting the "Owner Draw Fixed" button (which you have to do for CBitmapButtons, Owner Draw) but that makes me get an access violationb in the MFC dll, with none of my code in the call stack.
So I'm lost.:)
Here's more of the init code:
CImageList test;
test.Create( IDB_FEATURE_MENU, 70, 0,RGB(255,255,255));
m_tab.SetImageList(&test);
// Create a CImageList and associate this somehow to the tab control
// Then specify the image index for each item
TC_ITEM TabCtrlItem;
TabCtrlItem.mask = TCIF_IMAGE;
TabCtrlItem.pszText = "Quality";
TabCtrlItem.iImage = 0;
m_tab.InsertItem( 0, &TabCtrlItem );
TabCtrlItem.iImage = 1;
TabCtrlItem.pszText = "Finish";
m_tab.InsertItem( 1, &TabCtrlItem );
TabCtrlItem.iImage = 2;
TabCtrlItem.pszText = "Paper";
m_tab.InsertItem( 2, &TabCtrlItem );
TabCtrlItem.iImage = 3;
TabCtrlItem.pszText = "NiceStuff";
m_tab.InsertItem( 3, &TabCtrlItem );
mQuality.Create(IDD_MOP_QUALITY, &m_tab);
mFinish.Create(IDD_MOP_FINISH, &m_tab);
mPaper.Create(IDD_MOP_PAPER, &m_tab);
Thanks for any help you can offer!
You can reach me at: ivan@wrinkled.com
I'll check here too.