1 m_imagelist.Create(32,32,ILC_COLOR24|ILC_MASK,1,1); 2 CBitmap bmp; 3 for(int i=0;i<9;i++) 4 { 5 int a= bmp.LoadBitmapW(IDB_BITMAP1+i); 6 a= m_imagelist.Add(&bmp,RGB(255,255,255)); 7 a=bmp.DeleteObject(); 8 } 9 10 const UINT t[10] = {1001,1002,1003,1004,1005,1006,0,1007,1008,1009}; 11 m_toolbar.CreateEx(this); 12 m_toolbar.SetButtons(t,10); 13 m_toolbar.SetSizes(CSize(60,56),CSize(24,24)); 14 m_toolbar.SetButtonText(0,_T("文件管理")); 15 m_toolbar.SetButtonText(1,_T("屏幕监控")); 16 m_toolbar.SetButtonText(2,_T("超级终端")); 17 m_toolbar.SetButtonText(3,_T("进程管理")); 18 m_toolbar.SetButtonText(4,_T("服务管理")); 19 m_toolbar.SetButtonText(5,_T("卸载主机")); 20 m_toolbar.SetButtonText(7,_T("生成客户")); 21 m_toolbar.SetButtonText(8,_T("程序设置")); 22 m_toolbar.SetButtonText(9,_T("关于软件")); 23 m_toolbar.GetToolBarCtrl().SetImageList(&m_imagelist); 24 25 RepositionBars(AFX_IDW_CONTROLBAR_FIRST,AFX_IDW_CONTROLBAR_LAST,0);
需要创建CToolBar 和 CImageList