Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Changing ImageList in of ToolBar

Posted on 1998-06-08
3
Medium Priority
?
616 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
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.
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

715 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