Solved

Changing ImageList in of ToolBar

Posted on 1998-06-08
3
597 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Folder Comparison 12 53
ORA-01403: no data found 43 89
canBalance challenge 34 69
wordmultiple challenge 12 116
Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
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.
I designed this idea while studying technology in the classroom.  This is a semester long project.  Students are asked to take photographs on a specific topic which they find meaningful, it can be a place or situation such as travel or homelessness.…

948 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

20 Experts available now in Live!

Get 1:1 Help Now