//CMFCToolBarButton//第二个参数怎么关联Image图像列表的索引?
m_wndToolBar.SetUserImage(&m_UserImages); //CMFCToolBar m_wndToolbar CMFCToolBarButton(
UINT uiID,
int iImage,
LPCTSTR lpszText=NULL,
BOOL bUserButton=FALSE,
BOOL bLocked=FALSE
);
Parameters
[in] uiID
The command ID of the button. [in] iImage
The image index of the button in the collection of images. [in] lpszText
The text label of the button. Can be NULL. [in] bUserButton
A Boolean value that determines whether the button is user-defined. If this parameter is TRUE, the button is user-defined. Otherwise, the button image is loaded from a resource. [in] bLocked
A Boolean value that determines whether the button can be customized. If this parameter is TRUE, the button cannot be customized. Otherwise, the button can be customized.
解决方案 »
- VS2008 SP1 CDockablePane
- MFC中框架类的变量,传递到视图类的ONdraw函数中,为什么出错?
- SendMessage的用法。。。
- 怎样在对话框里点击画圆并且只能在棋盘的两直线交点画?????
- 对话框的调用问题
- GuiToolkit 类库的安装及使用问题...急...急... 帮帮我好吗?
- win2008 64位机上createthread 出错
- 程序开发完毕,怎么把debug版本该为release版本?
- 关于FtpFindFirstFile
- 请教一个很菜的问题关于classwizard
- 怎么让编辑框在达到限定长度后自动跳到下一个编辑框啊
- 如何控制clistctrl的重绘区域,解决闪烁的问题。
[in] iImage The image index of the button in the collection of images.
就是整个集里索引。
// CMFCToolBar m_wndToolBar;
// CMFCToolBarImages m_UserImages;
// CImageList m_wndImage;
//OnCreate函数里的DockPane(&m_wndOutput);加上下面的,怎么出不来图片啊?
//m_wndProperties.EnableDocking(CBRS_ALIGN_ANY);
//DockPane(&m_wndProperties);
//m_wndToolBar.InsertButton(CMFCToolBarButton(ID_FILE_NEW,0,L""));
m_wndImage.Create(32,32,ILC_COLOR32|ILC_MASK,0,0);
m_wndImage.Add(AfxGetApp()->LoadIcon(IDI_ICON2));
m_wndImage.Add(AfxGetApp()->LoadIcon(IDI_ICON3));
m_UserImages.CreateFromImageList(m_wndImage);
m_UserImages.SetImageSize(CSize(32,32), TRUE);
UINT nArray[2] = { ID_MENU1, ID_MENU1};
m_wndToolBar.SetButtons(nArray, 2);
m_wndToolBar.SetSizes(CSize(32,32),CSize(32,32));
m_wndToolBar.SetUserImages(&m_UserImages);
m_wndToolBar.SetButtonInfo(0,ID_MENU1,TBBS_CHECKBOX,0);
m_wndImage.Create(32,32,ILC_COLOR32|ILC_MASK,0,0);
m_wndImage.Add(AfxGetApp()->LoadIcon(IDI_ICON2));
m_wndImage.Add(AfxGetApp()->LoadIcon(IDI_ICON3)); m_UserImages.CreateFromImageList(m_wndImage);
m_UserImages.SetImageSize(CSize(32,32), TRUE);
为什么2个0,第一个是知道的(2),
第二个一般是 1,表示 备用 1个。