Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Changing ImageList in of ToolBar

Posted on 1998-06-08
3
Medium Priority
?
621 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 200 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

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
In this post we will learn different types of Android Layout and some basics of an Android App.
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.
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…

927 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