在Dialog类中添加两个私有成员变量m_imagelist,m_toolbar,类型如下CImageList,CToolBar
在OnInitDlalog方法中添加如下代码:
m_imagelist.Create(24,24,ILC_COLOR24|ILC_MASK,1,1);
m_imagelist.Add(AfxGetApp()->LoadIcon(IDI_ICON1));
m_imagelist.Add(AfxGetApp()->LoadIcon(IDI_ICON2));
m_imagelist.Add(AfxGetApp()->LoadIcon(IDI_ICON3));
m_imagelist.Add(AfxGetApp()->LoadIcon(IDI_ICON4));
m_imagelist.Add(AfxGetApp()->LoadIcon(IDI_ICON5));
UINT array[5]; //定义工具栏数组
for(int i=0;i<5;i++)