Originally posted by: Elina Lazebnik
I need change bitmaps for my toolbar (in FormView).
I can insert more from one bitmap to CToolBarCtrl by using CToolBarCtrl::AddBitmap() func. But I don't now how to change it in time of running.
Thanks
Originally posted by: Gaurav Gumber
Hi,
The article is superb. But the problem with me is that I have a number of ".ico" files, each containing an icon. Kindly tell me how to put that on a toolbar button.
Regards
Gaurav
Originally posted by: storein
It can load 256 Colors bitmap ,and you can dispose bitmap backgroud ,RGB (192,192,192 ) is Color Mask .and bitmap backgroud is RGB (192,192,192)
CImageList *pImgList = m_wndToolBar.GetToolBarCtrl().GetImageList();
pImgList->DeleteImageList();
pImgList->Create(48, 48, ILC_COLOR8 | ILC_MASK, 0, 10);
CBitmap ToolBarBm;
ToolBarBm.LoadBitmap (IDB_ToolBar);
pImgList->Add (&ToolBarBm,RGB(192,192,192));
CBitmap DisToolBarBm;
DisToolBarBm.LoadBitmap (IDB_DisaToolBar);
CImageList* pDisaImgList;
pDisaImgList=new CImageList ;
pDisaImgList->Create(48, 48, ILC_COLOR8 | ILC_MASK, 0, 10);
pDisaImgList->Add (&DisToolBarBm,RGB(192,192,192));
m_wndToolBar.GetToolBarCtrl().SetImageList(pImgList);
m_wndToolBar.GetToolBarCtrl().SetDisabledImageList (pDisaImgList);
Originally posted by: anuradha
i wants the codes for that? will u please help me?
How to Highlight the button on toolbar when cursor place on that button?
it is just like facility provided in win XP.
Originally posted by: Rai, Fumihiko
Also, the palette of your bitmap should be 256 colors.
Thanks, And hope it will help !!
I followed the steps but the disabled buttons were mixed up.
Therefore, I use the following codes to make it work.
CImageList *pImgList = m_wndToolBar.GetToolBarCtrl().GetImageList();
pImgList->DeleteImageList();
pImgList->Create(16, 16, ILC_COLOR8 | ILC_MASK, 0, nBtnCnt);
m_wndToolBar.GetToolBarCtrl().SetImageList(pImgList);
m_wndToolBar.GetToolBarCtrl().AddBitmap(nBtnCnt, IDR_MAINFRAME_256);
Originally posted by: John
When i try this example, the program either fails to run or crashes.
Reply
Originally posted by: Dan
If you change from 32 bit -> 16 bit color (actually between any two color depths), the bitmaps go black. Does anyone know of a solution for this or is it a bug in the toolbar control?
ReplyOriginally posted by: fhlove
I just want to change the background color of ToolBar.
How can i do that??
Originally posted by: serrand
Bad argument in AfxDeleteObject((HGDIOBJ*)&m_hbmImageWell);
Originally posted by: Raghav Gupta
Works great! Thanks a lot!
Reply