Home > Software engineering >  Unable to display icon in TAB head TabCtrl controls
Unable to display icon in TAB head TabCtrl controls

Time:11-13

Method one:
/* * pImage CImageList;
PImage=new CImageList ();
PImage - & gt; Create (32, 32, ILC_COLOR32 | ILC_MASK, 2, 2);
//add ICONS
HICON icon=AfxGetApp () - & gt; LoadIcon (IDI_ICON2);
PImage - & gt; Add (icon);
M_tab1. SetImageList (pImage); */

Method 2:
/* CImageList m_imglist;

M_imglist. Create (32, 32, ILC_COLOR32, 2, 1);
M_imglist. Add (AfxGetApp () - & gt; LoadIcon (IDI_ICON2));
M_imglist. Add (AfxGetApp () - & gt; LoadIcon (IDI_ICON1));
M_tab1. SetImageList (& amp; M_imglist); */

Method 3:
//CImageList m_imglist;
/* CBitmap bm.
M_imglist. Create (16, 16, ILC_COLORDDB | ILC_MASK, 2, 1);
Bm. LoadBitmap (IDB_BITMAP3);
Bm. LoadBitmap (IDB_BITMAP3);
M_imglist. Add (& amp; Bm, RGB (0, 0, 0));
M_tab1. SetImageList (& amp; M_imglist); */
With the three kinds of way, this was just in front of the TAB for some more blank, did not show design, strives for the big help to find out why, thank you very much!!!!!!

CodePudding user response:

https://www.codeproject.com/Articles/8/MFC-Grid-control-2-27

CodePudding user response:

//create images'
//if (! M_Imagelist. Create (16 dec, ILC_COLOR8 | ILC_MASK, 6, 4))
//AfxMessageBox (image "err", MB_ICONSTOP);

CodePudding user response:

refer to the second floor schlafenhamster response:
//
create images//if (! M_Imagelist. Create (16 dec, ILC_COLOR8 | ILC_MASK, 6, 4))
//AfxMessageBox (image "err", MB_ICONSTOP);
didn't pop up an error dialog

CodePudding user response:

M_imgList. Add (& amp; Bitmap , (a COLORREF) 0 XFFFFFF ).

CodePudding user response:

With a few button also can realize TabCtrl effect, is simple to use and never use TabCtrl, difficult to use and ugly
  • Related