Solved

Changing ImageList in of ToolBar

Posted on 1998-06-08
3
592 Views
Last Modified: 2013-11-20
I want to change the Imagelist of a ToolBar. The Toolbar is created and okay. Then the user can change the bitmap at runtime. How can I change the Bitmaps of the ToolBar to the new ones?
0
Comment
Question by:Heinig
3 Comments
 
LVL 7

Expert Comment

by:galkin
ID: 1316186
You can add more images to toolbar imagelist with CImageList::Add and then replace bitmap on a particular button with CToolBar::SetButtonInfo.
0
 

Author Comment

by:Heinig
ID: 1316187
That's not solving my problem, but it was a good hint. The ToolBar i have has some more features which are stored in registry. I don't want to Add new bitmaps to the Toolbar, because in Registry the other (old) bitmapnumber is stored. So I have to change the bitmap directly. Something like CImageList::Replace(...). But that doesn't seem to be the right way.
0
 
LVL 1

Accepted Solution

by:
motigust earned 100 total points
ID: 1316188
If you are using CToolBar class as your base class for the toolbar, you may use the CToolBar::LoadBitmap function. That function loads a specified bitmap from the resources. You may use this to replace all the images.

If you want to replace a specific image in your toolbar, you must
create and manage a bitmap yourself, and then use the CToolBar::SetBitmap function, each time you want to set the images.

0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now