Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MFC tab control and transparent images

Status
Not open for further replies.

bmoyer23

MIS
Dec 5, 2001
46
US
Is it possible to get bitmap images to show transparent on the tab control? What am I missing? My code is below. Thanks in advance.

void CSHCS_Params_Dlg::InitializeTabCtl(CTabCtrl * _tabTool)
{

TCITEM tcItem;
CImageList *imgl;
CBitmap bmp;

imgl = new CImageList();
imgl->Create(24, 24, ILC_COLOR32 | ILC_MASK, 0, 4);

bmp.LoadBitmap(IDB_BITMAP1);
imgl->Add(&bmp, RGB(255, 0, 255));
bmp.DeleteObject();

bmp.LoadBitmap(IDB_BITMAP2);
imgl->Add(&bmp, RGB(255, 0, 255));
bmp.DeleteObject();

bmp.LoadBitmap(IDB_BITMAP3);
imgl->Add(&bmp, RGB(255, 0, 255));
bmp.DeleteObject();

_tabTool->SetImageList(imgl);
tcItem.mask = TCIF_TEXT | TCIF_IMAGE;

tcItem.pszText = _T("Taps");
_tabTool->InsertItem(0, &tcItem);

tcItem.pszText = _T("Mills");
_tabTool->InsertItem(0, &tcItem);

tcItem.iImage = 2;
tcItem.pszText = _T("Drills - Twist");
_tabTool->InsertItem(0, &tcItem);

tcItem.iImage = 1;
tcItem.pszText = _T("Drills - Spade");
_tabTool->InsertItem(0, &tcItem);

tcItem.iImage = 0;
tcItem.dwState = TCIS_BUTTONPRESSED;
tcItem.pszText = _T("Drills - Braised Tip");
_tabTool->InsertItem(0, &tcItem);
_tabTool->SetCurSel(0);

}
 
Hi,
Please check _tabTool->InsertItem(0, &tcItem);
you are inserting all items at '0' th index.
Is it proper ?

thanks & regards,
~ Rudresh


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top