larger toolbar images
-
Hi to all. Is it possible to have a 32x32 images on toolbar while keeping 16x16 in menu. I created toolbar resource (IDR_TOOLBAR1) and set it's button size as 32x32 and load it:
if (!m_wndToolBar.CreateEx(this,...) ||
!m_wndToolBar.LoadToolBar(IDR_TOOLBAR1 ))
{
...
}When compiled and started toolbar correctly shows large btn images but menu is also enlarged showing 32x32 item images!? How to have menu images as before (small 16x16)? My app info: SDI, VS2008 Thanks in advance!
-
Hi to all. Is it possible to have a 32x32 images on toolbar while keeping 16x16 in menu. I created toolbar resource (IDR_TOOLBAR1) and set it's button size as 32x32 and load it:
if (!m_wndToolBar.CreateEx(this,...) ||
!m_wndToolBar.LoadToolBar(IDR_TOOLBAR1 ))
{
...
}When compiled and started toolbar correctly shows large btn images but menu is also enlarged showing 32x32 item images!? How to have menu images as before (small 16x16)? My app info: SDI, VS2008 Thanks in advance!
See here an project sample which use small and big toolbar in the same application ...
-
See here an project sample which use small and big toolbar in the same application ...
Thaks for yours replay. The sample you pointed to me unfortunaly uses images only on toolbar and not menu. I've pulled some ideas from it so thanks once again!
-
Thaks for yours replay. The sample you pointed to me unfortunaly uses images only on toolbar and not menu. I've pulled some ideas from it so thanks once again!
I've solved it
if (!m_wndMenuBar.Create(this))
{
TRACE0("Failed to create menubar\n");
return -1; // fail to create
}m\_wndMenuBar.SetMenuSizes(CSize(22,22), CSize(16,16)); m\_wndMenuBar.SetPaneStyle(m\_wndMenuBar.GetPaneStyle() | CBRS\_SIZE\_DYNAMIC | CBRS\_TOOLTIPS | CBRS\_FLYBY); // prevent the menu bar from taking the focus on activation CMFCPopupMenu::SetForceMenuFocus(FALSE); CMFCToolBarInfo tbInfo; tbInfo.m\_uiColdResID = 0; tbInfo.m\_uiDisabledResID = 0; tbInfo.m\_uiHotResID = 0; tbInfo.m\_uiLargeColdResID = 0; tbInfo.m\_uiLargeDisabledResID = 0; tbInfo.m\_uiLargeHotResID = 0; tbInfo.m\_uiMenuResID = IDR\_MAINFRAME\_256; if (!m\_wndToolBar.CreateEx(this, TBSTYLE\_FLAT, WS\_CHILD | WS\_VISIBLE | CBRS\_TOP | CBRS\_GRIPPER | CBRS\_TOOLTIPS | CBRS\_FLYBY | CBRS\_SIZE\_DYNAMIC) || !m\_wndToolBar.LoadToolBarEx(IDR\_TOOLBAR1, tbInfo)) { TRACE0("Failed to create toolbar\\n"); return -1; // fail to create }
- Call CMFCMenuBar::SetMenuSizes() before creating toolbar - Use CMFCToolBarInfo struct leaving all members to 0 except m_uiMenuResID where you pass yours 16x16 sized resource entry - CallLoadToolBarEx() Off course IDR_TOOLBAR1 is 32x32 sized