I would like to know if it's possible to set an image (and display only that, without text) in a CMFCToolbar
, in a top level CMFCToolBarButton
item (like File
, Edit
, Help
, etc.):
What I've tried, but has no effect:
CMFCToolBarMenuButton* button = DYNAMIC_DOWNCAST(CMFCToolBarMenuButton, m_wndMenuBar.GetMenuItem(0));
button->m_bUserButton = TRUE;
button->m_bImage = TRUE;
button->m_bText = FALSE;
button->SetImage(1);
m_wndMenuBar.UpdateButton(0);
Prior to this I'm setting some custom images like so (it's actually the generated MFC project, from VS2010):
if (CMFCToolBar::GetUserImages() == NULL)
{
// load user-defined toolbar images
if (m_UserImages.Load(_T(".\\UserImages.bmp")))
{
CMFCToolBar::SetUserImages(&m_UserImages);
}
}
So, is this possible or not? I would think that it is, since CMFCMenuBar
is derived from CMFCToolBar
, which supports it.
More info: Actually, what I'm trying to achieve is this (in red rectangle):
So I would like that in a classic menu bar (not ribbon like in the image), create an image button and right align it.