Changing the Image on the Toolbar button.
-
I want to change the image of the toolbar button, that is, When I cilcked one tool bar button then I want to change the image of the button. So I have used the following code, but it saying some runtime error. CToolBarCtrl &ctrl = m_wndToolBar.GetToolBarCtrl(); ctrl.AddBitmap(3,IDB_BITMAP3); Pls provide me some solution,
-
I want to change the image of the toolbar button, that is, When I cilcked one tool bar button then I want to change the image of the button. So I have used the following code, but it saying some runtime error. CToolBarCtrl &ctrl = m_wndToolBar.GetToolBarCtrl(); ctrl.AddBitmap(3,IDB_BITMAP3); Pls provide me some solution,
try using LoadImages(). and what is this AddBitmap?
-
I want to change the image of the toolbar button, that is, When I cilcked one tool bar button then I want to change the image of the button. So I have used the following code, but it saying some runtime error. CToolBarCtrl &ctrl = m_wndToolBar.GetToolBarCtrl(); ctrl.AddBitmap(3,IDB_BITMAP3); Pls provide me some solution,
gopalraja wrote:
ctrl.AddBitmap(3,IDB_BITMAP3);
This function is used to add bitmap to imagelist associated with toolbar control. Look at function SetImageList, and use it according to your need. Images on toolbar shown according to imagelist associated with that toolbar control.
-
I want to change the image of the toolbar button, that is, When I cilcked one tool bar button then I want to change the image of the button. So I have used the following code, but it saying some runtime error. CToolBarCtrl &ctrl = m_wndToolBar.GetToolBarCtrl(); ctrl.AddBitmap(3,IDB_BITMAP3); Pls provide me some solution,
Hi, You can set cold and hot images for the toolbar. This is the sample code. CImageList img; img.Create(IDB_HOTTOOLBARS, 22, 0, RGB(128, 128, 128)); m_wndToolBars.GetToolBarCtrl().SetHotImageList(&img); img.Detach(); img.Create(IDB_COLDTOOLBAR, 22, 0, RGB(255, 255, 255)); m_wndToolBars.GetToolBarCtrl().SetImageList(&img); img.Detach(); Here m_wndToolBars is the CToolBar object.And IDB_HOTTOOLBARS and IDB_COLDTOOLBAR are the Bitmap imges in the resourse editor. Regards Arun